Dean Foods (NYSE: DF) swung to a second-quarter loss on litigation costs and said it sees a tepid third quarter, sending its shares off more than 11%. The charge was related to a four-year-old lawsuit in which the Texas-based company was charged with fixing the price of milk. The settlement cost the company $131 million and ate into its second-quarter earnings.

To investors' dismay, the largest dairy producer in the U.S. also forecast a weak third quarter as it foresaw higher milk prices and falling demand. Here's what you need to know about Dean Foods' quarter.

A look at the numbers
Revenue for the quarter increased 12% to $3.29 billion from $2.95 billion a year ago. The company reported higher revenue as it raised prices in the face of higher input costs. Its WhiteWave-Alpro unit recorded higher sales, which helped add to the top line. Industry peers Kraft (NYSE: KFT) and ConAgra (NYSE: CAG) also reported strong quarterly numbers as they benefited from raising prices in the face of higher input costs.

However, higher input costs resulted in Dean Foods' cost of goods increasing to $2.53 billion from $2.20 billion, up nearly 15% from a year ago. And higher revenue could not totally offset the rise in costs, as evidenced by the gross margin that slipped to 23% from 25% a year ago.

Thus, higher input costs and one-time litigation costs resulted in the company incurring a loss of $50.5 million, compared with a profit of $44.8 million in the year-ago period. However, excluding these one-time expenses, Dean Foods recorded a profit of $32 million.

A brief look at the books
The company's total debt fell to $3.82 billion from $4.25 billion a year ago. Interest payments soak up more than half of operating earnings, so while the company is capable of paying off its short-term obligations, they are still eating into profits. Dean has been reducing debt as part of its fixed cost deleveraging strategy as overall volumes have been low. To offset this fall in volume, Dean cashed in on a $62 million tax refund and also through the sale of two of its yogurt businesses this quarter. This ultimately resulted in a $262 million reduction in debt.

The Foolish bottom line
Dean Foods reiterated its outlook for the rest of the year: It expects WhiteWave-Alpro to continue performing well through the year and deliver operating growth above 10%. But dairy prices are expected to keep rising this year, which will result in fluctuating demand as the economy still feels the effects of the recession. The company could continue to see some variable top- and bottom-line growth ahead.