The stock market despises uncertainty, and that's exactly what the latest economic data delivered on Friday. The Bureau of Labor Statistics' measure on consumer inflation showed a 1% monthly rise in May, bringing the year-over-year inflation gauge up to 8.6%, a fresh 41-year high. That led to massive declines for the Dow Jones Industrial Average (^DJI -0.98%), S&P 500 (^GSPC -0.46%), and Nasdaq Composite (^IXIC -0.64%), which were down as much as 3.5%.

Index

Daily Percentage Change

Daily Point Change

Dow

(2.73%)

(880)

S&P 500

(2.91%)

(117)

Nasdaq

(3.52%)

(414)

Data source: Yahoo! Finance.

Market participants traditionally turn to a number of investments that they feel have the power to resist inflationary pressures. Some have looked to the cryptocurrency market as a potential inflation hedge, but it hasn't delivered on that promise just yet. Instead, an asset that people have used for thousands of years as a store of value -- gold  -- showed solid gains, and that gave a big boost to mining and stocks that produce the precious metal.

A solid day for gold

The price of gold was higher on Friday, even as stock and bond markets both gave up ground. Gold gained about $23 per ounce, climbing up to $1,872 per ounce late Friday afternoon.

The rest of the precious metals group saw more mixed results. Silver gained $0.17 per ounce to $21.85, which showed its dual role as both an industrial metal and a store of value. Platinum and palladium, however, were closer to unchanged, as their demand rests largely in industrial uses that could face cyclical pressure in the event of a recession.

The move higher in bullion was good news for gold mining stocks. South African miners Gold Fields (GFI 2.59%) and Harmony Gold Mining (HMY 3.32%) led the way with gains of 9% to 10%, but North American producers New Gold (NGD 4.65%) and IAMGOLD (IAG 3.06%) weren't far behind, picking up 9% and 7% respectively.

Silver miners, which often produce smaller amounts of gold as a byproduct of their primary silver mining operations, also showed solid gains. Endeavour Silver (EXK 3.33%) and Silvercorp Metals (SVM 2.31%) climbed 8% each, while Hecla Mining (HL -3.63%) picked up 7%.

Challenges for gold

Some investors might have thought that an asset with the historical reputation for being an inflation hedge would have been able to perform better after such an inflationary CPI report. However, the problem is that gold investors have to pay attention to macroeconomic factors as well in their decisions to invest in precious metals.

For bullion investors, buying gold often involves taking leveraged positions. These positions are sensitive to interest rates, so when the Federal Reserve is raising rates, it's more costly for gold investors to keep their positions open. That's likely one reason why gains in gold bullion prices were muted on Friday, because the higher inflation also makes it more probable that the Fed will raise interest rates more aggressively.

Meanwhile, gold mining companies also tend to have some debt exposure. In addition, inflation can lead to higher costs, especially with key inputs like diesel fuel seeing massive price spikes. Even if gold prices rise, therefore, it's no guarantee that earnings of mining companies will follow suit. It could be that instead, all the extra revenue goes toward paying higher expenses.

All in all, having gold stocks in your portfolio has been a mixed bag over the long run. It's certainly serving as a solid hedge today, but longer-term performance has lagged badly during the long bull market in stocks during the 2010s. Nevertheless, gold stocks could continue to see short-term gains if inflationary pressures persist.