What happened

Shares of miner Teck Resources Limited (NYSE:TECK) advanced 25% in July. That's an impressive gain, to be sure, especially for a miner heavily reliant on coal, but to really understand that advance you have to go back to the middle of June, when the company updated its coal production guidance. Between June 16 and the end of July, the stock was up a massive 45% or so.

Teck also produces zinc, copper, and lead, but in recent years volatile coal markets have been the biggest wild card.

Two people standing in a coal mine

Image source: Getty Images.

So what

The company's coal production guidance was generally good reading, as the massive stock-price advance suggests. For example, the company noted that realized prices would likely be between $160 and $165 per tonne. When the company reported earnings on July 27, that number turned out to be $169 per tonne and, more important, roughly double the year-ago figure. A key factor in that advance was a weather event that led to a price spike in April.

Teck also announced that it expected to produce between 6.8 million and 7 million tonnes of met coal. The final number was 6.9 million tonnes. That just happens to be a record for the second quarter. So you can see why the mid-June update led investors to push the shares higher right through July.

The earnings release, meanwhile, contained more good news than just coal. For example, copper, zinc and lead prices rose in the quarter 20%, 35%, and 26%, respectively, year over year. And production was strong in copper and zinc. All in all, the earnings release confirmed the positive trends hinted at by the production update, and added positive news throughout the rest of the company. Earnings of $1.00 per share, meanwhile, were well above the $0.03 a share earned in the second quarter of 2016.

Now what

News on the coal front has had a disproportionate impact on Teck's shares lately. This is understandable since the met-coal market has been particularly volatile over the past year or so.

That said, it looks like Teck is benefiting quite nicely overall despite coal's price swings. And, at the same time, it's been using this period to strengthen its balance sheet, lowering debt by roughly 30% over the same period last year. There's no way to predict what will happen next in coal, but Teck is definitely moving in a good direction when you look at the business as a whole.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.