The past doesn't always remain there. For one company in a molten-hot industry, the past crept right into the present and destroyed a quarter's earnings.

Despite strong operational results, Massey Energy (NYSE:MEE) has swung to a loss for the second quarter, burdened by a $245 million pre-tax charge relating to litigation. Unfortunately for this coal-mining giant, its legal horizon remains cloudy.

After agreeing to pay the EPA a $20 million civil penalty for Clean Water Act violations, and losing a $220 million contract dispute case with Wheeling Pittsburg Steel Company, 2008 has been a rough year for Massey on the legal front. Potential troubles still loom: Massey is facing a possible $125 million in damages from a case involving groundwater contamination in West Virginia, with plaintiffs expected to request much more in punitive damages.

The $245 million pre-tax charge Massey registered from the Wheeling Pittsburg case offset what would have been a $92 million net gain, delivering instead a $93 million loss for the second quarter. Revenue from coal production rose 38% to $710 million, the operating cash margin rose 83% to $15.94 per ton, and the average realized sales price across all coal types rose 28% to nearly $66 per ton.

The outlook for Massey's operations appears very strong as well. The company expects about 30% of production for 2009 and 2010 to consist of metallurgical coal, which will help to catapult average realized coal prices. To reach an anticipated 50 million tons of coal production in 2010, Massey plans to build three to six new preparation plants and shipping facilities. The company completed a train loadout facility in the second quarter that will funnel Massey's products onto Norfolk Southern (NYSE:NSC)'s rail lines for transport.

Fools have observed a huge uptick in consolidation within the met coal industry of late, including Cleveland-Cliffs (NYSE:CLF)'s bid for Alpha Natural Resources (NYSE:ANR) and Teck Cominco (NYSE:TCK)'s run for Fording Canadian Coal Trust (NYSE:FDG). Referring to this trend, Massey's predicts that "vertical integration by steel producers has and will continue to drive consolidation within global metallurgical coal production and could result in additional supply constraints."

With robust met coal production in the pipeline, Massey itself could be an enticing target. However, any potential suitors -- just like investors -- must keep Massey's legal issues in mind.

Further Foolishness:

The "Coal" tag within the Motley Fool CAPS community lists 21 coal companies. Find out what other investors are saying about the stocks you're watching, or share your Foolish thoughts with us. CAPS is 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 Cleveland-Cliffs, Teck Cominco, and Massey Energy. The Motley Fool has a disclosure policy.