The Dow Jones Industrial Average closed up 45.94 points (0.36 percent) at 12,684.68.
The broader S&P 500 index gained 6.09 points (0.45 percent) at 1,346.29, while the tech-heavy Nasdaq Composite rose 15.69 points (0.55 percent) to 2,843.25.
The markets got a boost from a six percent rise in crude oil prices and a 1.5 percent rise in the price of gold, after both plunged last week together with a host of other commodities popular with speculators.
Oil and gas companies and miners were mostly higher, and commodity funds, especially for silver and gold, were some of the heaviest traded shares.
"Traders seem relatively unruffled by a Standard & Poor's downgrade for debt-strapped Greece not to mention the threat of additional downgrades from Moody's," said Elizabeth Harrow at Schaeffer's Investment Research.
"Silver futures rebounded from the worst weekly slump since at least 1975 and gold gained on speculation investors will return to commodity markets as concerns over the global recovery eased," said Scott Marcouiller of Wells Fargo Advisors.
Food service giant Sysco shares added 10.7 percent after beating analysts' forecast for its fiscal third quarter despite a sharp rise in food costs.
MGM Resorts was heavily traded and finished up 1.7 percent after its first quarter report at the end of last week beat forecasts though the gaming and hotels company was still losing money.
Dow component Intel lost 2.1 percent in heavy trade.
Bond prices were mixed. The yield on the 10-year Treasury note fell to 3.14 percent from 3.16 percent late Friday, while that on the 30-year bond held steady at 4.30 percent.
Bond yields and prices move in opposite directions.