At the beginning of this year, it seemed that Barrick Gold Corp. (TSX:ABX)(NYSE:ABX) was headed for bankruptcy. Gold prices had plunged, the company was burning through cash, and the debt load stood at a staggering $13.1 billion (all currency figures are presented in USD). Executive Chairman John Thornton set a goal of reducing debt by $3 billion, but analysts were skeptical it could be done in such an awful gold environment.

Fast forward to today, and it seems the company has turned a corner. Results for the third quarter came in better than expected, with adjusted earnings of $0.11 per share, beating analyst estimates of $0.07. The company lowered its full-year outlook for all-in sustaining costs to $830-870 per ounce. And most importantly, the debt load has been reduced dramatically. In fact, Barrick expects to meet its $3 billion goal without any more asset sales.

Despite all this progress, Barrick’s shares are still down by over 25% this year. Over this same time, gold prices have fallen by only 5%. That leads to a very obvious question: Are Barrick’s shares a bargain?

A starting point

Based on Barrick’s current stock price, the company’s equity is valued at roughly $9 billion. On top of that, the company has $8 billion in net debt (after deducting cash). So, the company’s total mining operations are valued at approximately $17 billion.

From there, you can deduct $1 billion to reflect Barrick’s remaining stake in the Zaldivar copper mine (its other copper mine is worth very little). Thus, the market is valuing Barrick’s gold production at $16 billion. Based on this year’s estimates, that’s equivalent to just over $2,500 per ounce of production.

At current gold prices, Barrick can earn roughly $300 in pre-tax profit per ounce of production. This means the company’s gold operations are valued at approximately nine times pre-tax earnings.

How does this change with gold prices?

Of course, Barrick’s fate is very dependent on the price of gold. To illustrate, suppose that Barrick keeps the same nine times multiple, but the gold price increases by just $100 per ounce. That would cause Barrick’s stock price to rise by nearly 50%! Of course, it works the other way as well; a $100 fall in gold prices would nearly chop Barrick’s equity value in half.

Should you buy?

I would hold off on buying Barrick stock for now. The nine times multiple makes the stock tempting, but the risk of declining gold prices is just too high. Besides, mining is a very capital-intensive business; eventually, Barrick will have to spend heavily just to maintain its existing production. If gold prices fall in the meantime, then the company’s debt load may be too much to handle.

Fortunately, there are better alternatives. If you’re looking to bet on the price of gold, an ETF is probably your best option. If you’re looking for quality stocks, then you should probably look outside this sector altogether. The same thing can be said if you’re looking for reliable dividends. Either way, Barrick is still a stock to avoid.

Barrick is still too risky. You should buy this stock instead

Our analysts have identified this company as one TOP stock for the rest of 2015 and beyond. And you can download the name, ticker symbol, and price guidance absolutely FREE.

NEW! This Stock Could Be Like Buying Amazon In 1997

For only the 5th time in over 14 years, Motley Fool co-founder David Gardner just issued a Buy Recommendation on this recent Canadian IPO.

Stock Advisor Canada’s Chief Investment Adviser, Iain Butler, also recommended this company back in March – and it’s already up a whopping 57%!

Enter your email address below to claim your copy of this brand new report, “Breakthrough IPO Receives Rare Endorsement.”

Fool contributor Benjamin Sinclair has no position in any stocks mentioned.