Gold Fields [JSE:GFI] was the biggest climber on Johannesburg's broader All-share index, gaining 6.6% to its highest level in more than a year.
A weaker rand, which plumbed fresh six-year lows against the dollar, helped those companies, who export gold in dollars.
"Our markets are being buoyed by a weak rand, the volatility in global markets are providing some sort of safe-haven situation for gold," said Bruno van Eck, a trader at Thebe Stockbroking.
The Gold Mining index jumped 4% as the spot price of gold hovered at seven-week highs, supported by weak global stock markets and a weaker dollar.
Africa's largest gold producer, AngloGold Ashanti [JSE:ANG], rose 2.5% while smaller rival Sibanye [JSE:SGL] added 2%.
The benchmark Top-40 share index ended 0.35% higher at 43 062 points, while the All-share was up 0.39% at 48 745 points.
Both indices had posted their biggest one-day loss in a year on Tuesday as falling oil and commodity prices depressed sentiment.
Cement maker PPC [JSE:PPC] was another gainer on Wednesday. It rose as much as 6% before ending 2.3% higher after it said it had received a merger proposal from unlisted rival Afrisam Group, a tie-up that would dominate the domestic building material market.
Trade on the Johannesburg stock exchange was active on Wednesday with more than 227 million shares sold, according to preliminary bourse data. Daily average turnover last year, for example, was 176 million shares.