It's enough to make your milk curdle. Food and beverage company Dean Foods (NYSE:DF) reported its second-quarter profits fell 8% because of high raw milk costs. Yet it was those same high costs that allowed sales to rise 26% in the same period as they translated into higher prices.

Raw milk prices reached record levels back in the spring. Spurred on by a freeze on Canadian dairy cattle imports because of mad cow disease and the popularity of high-protein diets, which led to the slaughter of more dairy cows, raw milk prices rose 87% in the quarter.

It was a similar trend over at rival Kraft Foods (NYSE:KFT) as it recently reported earnings were off 26%, even as sales rose 5%.

The prospect of having to take out a second mortgage to pay for your next gallon of milk appears to be ameliorating as milk prices slowly return from the stratosphere. While Dean says it's reiterating guidance from last quarter for full-year earnings between $2.21 and $2.26, that guidance had been below analyst expectations and is actually $0.02 less than the $2.28 the milk magnate had forecast at the high end.

Dean Foods sports some well-known brands, including Hershey's chocolate milk, Land o' Lakes butter, Marie's dressings, Silk soy milk, and International Delight creamers. While these branded products saw sales rise 70% in the quarter to $288 million, it was not enough to whip up earnings per share, which fell 13% to $0.47 per diluted share.

The industry is still in the midst of heavy consolidation, and Dean is a leader at it, snapping up Horizon Organic during the quarter. That's on top of its acquisition of Ross-Swiss Dairies earlier this year and Kohler Mix Specialties last year. And it still might be interested in picking off some of troubled Parmalat's dairy assets.

Given enough consolidation, Dean Foods may end up as the "last man standing" in the industry, but as an investment it seems about as tasty as sour milk.

Fool contributor Rich Duprey has cried over spilled milk. He does not own any of the stocks mentioned in this article.