Gold rally giving these stocks a major boost

gold bars.jpg

As gold rallied Tuesday, a handful of stocks found new sheen as investors switched into risk aversion mode.

Newmont Mining was the biggest gainer on the S&P 500, closing up nearly 4 percent, while Kinross Gold, Agnico Eagle Mines and Yamana Gold increased about 5 percent.

Small-cap gold producers IAMGOLD and AuRico Gold closed the session 11 percent and 6 percent higher, respectively.

Gold ETFs, including Market Vectors and Goldcorp, rose as much as 4 percent.

Investors should remember that gold mining shares are not going to trade in lockstep with the commodity, CNBC's Jim Cramer said Tuesday.

"If you pick the right company, one with low costs that's growing in production, then it can out perform the commodity for a period of time," Cramer said.

Read MoreGold rallying Tuesday, but new lows seen in 2015

But "The things that make gold gold valuable--it's scarcity, the fact that it's hard to get out of the ground… that makes the gold mine business perilous."

He said the best way to get exposure to gold is to is to own the SPDR Gold Trust "not some gold miner that's only loosely connected to the price of the underlying commodity."

A wave of risk aversion swept through global markets on Tuesday, and the U.S. dollar, which typically moves inversely with gold, slumped against a basket of major currencies.

Gold futures for February delivery settled $18.50 higher on Tuesday at $1,200.40 an ounce, but the market was viewed as technically bearish as it remained below the long-term resistance level at $1,235.

"The one encouraging thing for the bulls today is that today's volume is stronger than what we've seen lately, but until we close above $1,235, bulls shouldn't get excited,'' said Teddy Sloup, senior market strategist for iiTrader in Chicago.

—Reuters contributed to this report.

Gold / US Dollar Spot