Valero Energy Corp., the largest independent oil refiner in the U.S., reported today a loss of $254 million or 48 cents per share in the second quarter citing lower diesel and jet fuel margins and lower sour crude oil differentials.

Revenue was $17.9 billion in the second quarter from $36.6 billion a year ago.

Wall Street analysts forecasted a loss of 39 cents per share, according to FactSet Research while Thomson Reuters' survey predicted Valero was expected to report a loss of 50 cents per share and revenue of $15.2 billion.

Valero's net income for the first half of 2009 was $55 million or 11 cents per share compared to a net income of $995 million or $1.85 per share in the same period a year ago, the company said.

This is a very challenging environment for sour crude oil refiners. The downturn in the global economy has sharply reduced demand for refined products at a time when new refining capacity is coming online around the world, said Bill Klesse, Valero’s Chief Executive Officer in a released statement.

The economic downturn has refiners hard as demand for fuels slowed and inventories piled up.