Commodities prices that have been skidding lower for months turned around as investors seemed to have more of an appetite for risk. Gold picked up more than $36 an ounce. That advance spilled over to the stock market, lifting energy stocks including Exxon Mobil Corp., which rose 2.4 percent, and mining company Freeport-McMoRan Copper & Gold Inc., which added 16 percent.

Shifting sentiment over a possible bailout deal for Detroit's Big Three automakers also tugged at stocks throughout the session. That had major indexes alternating between gains and losses in afternoon trading and dragged financial stocks lower. Financial houses that hold investments in the car companies could see further strain on their balance sheets if big players like General Motors Corp. file bankruptcy.

The session's gains represent the continuation of the market's advance since late November. It has been punctuated by a few steep selloffs, including Tuesday's slide. But most trading had been more subdued than in September and October. The less panicked tone has helped boost confidence that the market might be stitching together a sustainable bottom.

Wall Street remains nervous about the level of opposition to efforts to aid U.S. automakers. Democrats in Congress and the White House finalized an agreement on $14 billion in loans for Detroit's struggling car companies. However, the plan negotiated by the White House is being opposed by a group of conservatives led by Sen. John Ensign, R-Nev.

At close, the Dow Jones industrial average rose 70.09, or 0.81 percent, to 8,761.42. On Tuesday, the Dow shed 243 points as investors after disappointing corporate news reminded investors of the magnitude of the economy's troubles. Stocks have rallied for two sessions before the decline.