NEW YORK — The fact the share price of Dean Foods Co. “only dropped 4%” in the wake of the company’s announcement that it sustained a loss in the second quarter represents a sign in the eyes of one Wall Street analyst dairy product costs are poised for a downturn and possibly a steep decline.

Robert Moskow, an analyst with Credit Suisse, on Aug. 12 raised Dean Foods to an outperform from a neutral rating.

On an adjusted basis, Dean Foods sustained a loss of $12,730,000 in the second quarter ended June 30, versus net income of $24,197,000, or 26c per share on the common stock, during the second quarter of 2013. Net sales were $2,393,869,000, up 7% from $2,227,542,000.

In connection with the earnings, Gregg Tanner, Dean Foods’ chief executive officer, called the outlook for the rest of the year “rocky” and withdrew full-year earnings guidance. He did say the company would sustain a loss in the third quarter.

“This is by far the most difficult operating environment in the history of the company, reinforcing the importance of the initiatives we have under way,” Mr. Tanner said.

The company blamed an “extreme dairy commodity environment,” which has contributed to “softening category volumes, mix shift out of our brands and significant cost friction.”

Mr. Moskow called the Dean results “about as bad as anyone could possibly predict.”

Still, the fact Dean’s stock price did not decline more steeply indicates that investors see the bad news as “washed out” of the company’s shares, leaving Dean positioned to benefit from an improving operating environment when (and if) commodity dairy prices fall, he said.

During the quarter, U.S. Department of Agriculture milk price estimate rose to $25.50 a cwt in April, up 31% from April 2013. The average price in 2012 was $17.44 per cwt.

“With global and domestic dairy supplies now increasing rapidly and demand starting to ease, we think prices have nowhere to go but down from here,” Mr. Moskow said. “We continue to harbor concerns about the long-term future of Dean Foods, but we like the risk-reward balance in the stock over the next nine months as the falling costs bring Dean’s margins get back to a more normal range.”

Mr. Moskow said dairy farmers should fare reasonably well in the falling milk price environment, insulated by the large prospective corn crop and the steep drop in feed costs.

Big picture dairy industry fundamentals explain Mr. Moskow’s long-term skepticism, he said.

“We believe that declining domestic demand for milk, excess industry capacity, long-term demand for exports, and declining bargaining power with customers will continue to challenge the Dean business,” Mr. Moskow said. “The company has made significant progress toward reducing its cost structure ($80 million to $100 million per year) through manufacturing consolidation, overhead reductions, and logistics productivity to offset these challenges.  It remains to be seen whether these improvements will result in a more sustainable pattern of margins for Dean.”

The expectation of improved results in the medium term is not without hazards, Mr. Moskow said. Noting it is always risky to predict the direction of commodity prices, Mr. Moskow said a recovery in the share price of Dean Foods also could be undone if the company’s capacity utilization is not strong enough.

“There have been years in the past where Dean has been forced to sacrifice its margin structure to outbid competition for private label business,” Mr. Moskow said. “That said, our analysis indicates that Dean’s profit margins expanded in three of the past four years where Class I prices fell.”

Share prices of Dean Foods on the New York Stock Exchange closed Aug. 11 after the earnings were released at $15.20 per share, a rally from the low of $14.19 during the trading session. The close was down 29% from the 52-week high of $21.46.