After an impressive multi-year run, shares of refiners have cracked under the pressure of crack spreads. If we look back to the beginning of 2003 -- those good ol' days when a gallon of gasoline averaged about $1.40 per gallon, while crude sold for $30 per barrel -- we may find the root of the problem. Crude prices have risen more than 300% since that time to trade above $120 per barrel today. Gasoline prices, while certainly difficult to stomach at present levels, have risen by a much smaller percentage of 180%.

Since independent refiners must purchase crude oil to make gasoline, that disconnect in pricing between the two products is precisely why shares of refiners like Valero (NYSE:VLO) and Sunoco (NYSE:SUN) are languishing lately.

Valero did not suffer from a lack of revenue in the second quarter. Revenue rose 51% to $36.6 billion. The fact that net earnings declined 67% despite that huge revenue upswing ... that is the manifestation of the pricing disconnect outlined above. Gasoline margins dove around 80% from the year ago quarter.

For a real brain teaser, consider that Valero is one of the lucky ones. Valero's facilities are equipped to refine the cheaper feedstock of sour and heavy crudes that other refiners can not, giving the company a competitive edge on refining costs. This may have something to do with why Valero shares have fallen only 50% over the past year, while competitors Western Refining (NYSE:WNR) and Tesoro (NYSE:TSO) have tumbled 85% and 67%, respectively. As my Foolish colleague David Lee Smith recently pointed out, even integrated oil giants like ConocoPhillips (NYSE:COP) and ExxonMobil (NYSE:XOM) are feeling the refining pain. Despite unprecedented oil prices, shares of both of those companies have traded sideways for the past year.

Market conditions for distillates like diesel, jet fuel, and heating oil are much more favorable for Valero, and the company plans to continue shifting its production mix towards those higher-margin products and away from tight-margined gasoline. I stand by my prior prediction that gasoline prices will ultimately catch up to the rise in oil (today's unexpected drop in gasoline stocks certainly helps), and view Valero as a solid long-term hold.

Further Foolishness:

If you are interested in refining knowledge and insight into profit, join the talented community of investors active within Motley Fool CAPS; it's free and fun!

Fool contributor Christopher Barker captains yachts and writes about stocks. He can also be found blogging actively and acting Foolishly within the CAPS community under the username TMFSinchiruna. He owns shares of Valero. The Motley Fool has a refined disclosure policy.