What happened

Coal stock Peabody Energy (BTU 0.30%) is on fire today, up a whopping 14% as of 12:22 p.m. EDT. It's a stunning turnaround after the stock's 17% drop in the five trading days through June 20. There's a lot brewing here.

So what

Coal prices have shot up in recent months and breached $150 a metric ton this week to hit record highs. That's music to Peabody Energy's ears, simply because its profitability depends directly on coal prices.

Several factors are driving coal prices higher. To start, a massive heat wave in China (the world's largest coal consumer) has sent demand for electricity to unprecedented levels, forcing the nation to jack up its coal production to keep coal-fired power plants running. As of July 15, average daily coal consumption in China crossed 2.2 million metric tons to hit a historical high, according to a report from Reuters.

Warmer-than-expected weather in the U.S. has driven prices of natural gas higher. Because that's a competing fuel source, a rise in its price encourages electrical utilities and industrial consumers to switch to traditional sources like coal, boosting its demand and price.

A miner's safety helmet in a coal mine.

Image source: Getty Images.

Thanks to rising natural gas prices, the U.S. Energy Information Administration (EIA) now projects higher coal production and forecasts that the share of coal in electric power generation in the U.S. will rise to 24% this year from 20% in 2020.

Given the backdrop, it's not hard to see why Peabody shares are soaring. In July, at least two analysts also upgraded their price targets on the stock. Jefferies doubled its price target to $8 on July 1, and B. Riley bumped its target by 75% to $7 on July 14.

Now what

July 29 could be a big day for Peabody Energy shares as the company will release its second-quarter earnings report that day. Traders, and perhaps even investors, are scooping up some shares of the coal stock ahead of its earnings in anticipation of a rosier outlook from the company given the ongoing strength in coal prices. It's therefore likely the stock will continue its momentum at least through the earnings date.