Five days later, it happened. Gold futures clipped the $1,538 level, and had lost 4% of their value just a few hours later. By Monday, that loss had widened to 12.6%. It was the worst two-day loss for gold in modern history.

As bad as it has been for gold, it’s been even worse for gold miners. While the SPDR Gold Shares (NYSE:GLD)has now lost 12% of its value between last Thursday’s close and yesterday’s close, the Market Vectors Gold Miners ETF (NYSE:GDX) has given up 15% of its value during that same span.

The reason? Gold miners’ profits exponentially increase and decrease with the rise and fall of gold prices. With that in mind, it’s not difficult to understand why investors have been so desperate to shed mining stocks lately.

However, not every gold mining stock deserved the drubbing it got. Some of these companies were just in the wrong place at the wrong time, and their recent pullbacks are actually buying opportunities.

Streaming Savvy

Believe it or not, the biggest headache in the gold mining business isn’t finding gold. It’s coming up with money needed to dig it up in meaningful quantities. Large, deep-pocketed companies can generally fund their efforts, but small- and even midsize explorers can’t always secure the capital they need to begin production.

That’s where a streaming company comes into play.

In simplest terms, a gold (or silver, or oil, or whatever) “streamer” provides the needed cash for an under-funded miner to bring a particular project online. In return, that miner agrees to sell gold or silver to the streamer at below-market prices once production begins. The streamer usually turns right around sells that gold at the market price, pocketing the difference.

There’s an upside and a downside to the streamer in this relationship. The downside is, there’s an effective cap on profits, and no guarantee that gold production will be strong. The upside is, there’s less financial risk to a streamer than for a straightforward explorer. Plenty of investors can tolerate less upside when there’s less downside.

Among the gold streamers, Sandstorm Gold (AMEX:SAND) is one of the best, as it negotiated a cherry of a deal with its primary project — the Aurizona Gold Mine in Brazil. The deal gives Sandstorm the right to buy 17% of the mine’s gold output at a price of $400 per ounce.

The company believes the project is capable of yielding 60,000 ounces this year and for years to come, 10,000 ounces of which is Sandstorm’s to buy. Even after gold’s pullback, that’s more than $13 million worth of gold that would only cost the company about $4 million to buy. Granted, that doesn’t reflect Sandstorm’s upfront cost, but it’s still a very lucrative agreement.

Cost Control Is Half the Battle

Don’t assume weakening gold prices means every miner is going to be forced to dip into the red ink. The ones that really know how to contain costs will survive just fine.

Take Goldcorp (NYSE:GG),for instance. In 2012, its cash costs to dig up an ounce of gold were only $220, versus an average of around $462 for all the major players in the industry. There are also non-cash costs involved, and adding those in brings the total per-ounce cost to $910 per ounce as of Q4 2012. But that’s still below the industry average of $1,200, and still leaves more than $400 of profit for every ounce of gold the company mines.

Don’t get the wrong idea — falling gold prices will still crimp Goldcorp’s margins. But the stock’s 10.4% plunge over the past two sessions suggests that people think it’s unprofitable, when, really, the company is well within its margin of safety.

Diversity is Always Smart

Finally, bargain hunters might want to mull Barrick Gold (NYSE:ABX), if only because it has been one of the hardest hit mining names, making it more ripe for a rebound than most of its peers. It has fallen 20% in just the past two days, and is off by more than 32% for the month.

That’s not the only reason one might want to own Barrick Gold, however.

Barrick Gold isn’t just a gold mining stock. The company has interests in silver and copper mines. Indeed, by weight, its silver reserves are more than seven times greater than its known gold reserves, and its 13.9 billion pounds of copper reserves outright dwarf its known gold and silver deposits of 140 million and 1.0 billion ounces, respectively. Gold just happens to be worth much, much more than copper. Still, ABX has plenty of diversity.

It should be noted that most metals — including copper and silver — have been losing value with gold of late. But gold’s a fickle beast, and demand can dry up at a moment’s notice. At least with copper and silver, there’s a semi-reliable industrial demand to keep the company humming through the hard times.

Bottom Line

All of that being said, the market still might have some mistreatment in store for these names, so tread lightly. But, as they say, “the time to buy is when there’s blood in the streets.”

Just be picky about your purchases.

As of this writing, James Brumley did not hold a position in any of the aforementioned securities.