Image source: Getty Images

What: Coeur Mining, Inc. (CDE 0.23%) shares rose an impressive 41.5% in June. That brings the full-year gain at this precious-metals miner to more than 330%. That's pretty impressive.

So what: There are two big reasons behind Coeur's huge stock advance. First, the miner has been working hard to bring down its all-in sustaining costs. For example, the company's all-in sustaining costs for a silver equivalent ounce (this number mixes the company's gold and silver production costs) were $19.50 or so in 2013. At the end of the first quarter that number had fallen to a little over $16 an ounce. Clearly, a precious-metals downturn pushed the company in this direction, but that doesn't change the fact that it's been able to get costs down in a big way.

The real catalyst for the huge stock price gain, however, is that silver has been moving higher this year. And as silver moves higher, Coeur moves closer and closer to turning a profit. The roughly 17% silver rally in June, though, pushed the price of silver to more than $18.50 an ounce. A little simple math shows why this is so important -- silver is currently priced well above what it costs Coeur to pull the metal out of the ground. That hasn't been the case for most of the year.

Now what: With silver up and costs down, there's good reason to expect positive news at Coeur Mining on the profit front. Don't look for that to happen right away, since the second quarter is already over, but it is reasonable to expect improved numbers when the company next reports earnings. And if silver prices hold up, more good news could be on the way in the second half.

That said, Coeur is still a risky play, since a fall in silver would likely have a negative impact on investor sentiment -- especially if the price declines below the company's all-in sustaining costs. Basically, Coeur is only worth looking at if you think silver is going to hold at current levels or move even higher.