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. 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. 10 stocks we like better than Teck ResourcesWhen investing geniuses David and Tom Gardner have a stock tip, it can pay to listen. After all, the newsletter they have run for over a decade, Motley Fool Stock Advisor, has tripled the market.* David and Tom just revealed what they believe are the 10 best stocks for investors to buy right now... and Teck Resources wasn't one of them! That's right -- they think these 10 stocks are even better buys. Click here to learn about these picks! *Stock Advisor returns as of August 1, 2017Reuben Brewer has no position in any stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.