RICHMOND, Va. (AP) â¿¿ James River Coal Co. said Thursday it posted a $25.8 million second-quarter loss, hurt by weak coal demand and prices. Despite the loss, the results were better than Wall Street expected and James River shares rose nearly 8 percent in premarket trading. The stock has lost about two-thirds of its value in 2012 on a broad slump in coal demand. James River mines thermal coal used for power generation and metallurgical coal, used to produce steel. The coal industry has been battered this year as U.S. utilities switch to cheap natural gas to generate electricity instead of coal, mild weather in the U.S. hurt demand and the recession in many European countries, combined with a slowdown in Asia, stifled exports. The Richmond, Va., miner said it remains cautious on steelmaking coal because of the weak global economy, while it believes the market for thermal coal is just beginning to show signs of recovery. The company's loss amounted to 74 cents per share in the April-June quarter, compared with a profit of $789, 000, or 2 cents per share, in the same period last year. Revenue tumbled 21 percent to $277.4 million from $352 million, as coal sales dropped 21 percent to $259.6 million. Coal shipments fell 11 percent to 2.9 million tons. Analysts, on average, expected a loss of 80 cents per share on $276 million in revenue, according to a FactSet poll. James River shares rose 17 cents, or 7.6 percent, to $2.40 in premarket trading.