"When you have as sharp a decline as we had last week plus yesterday, it attracts a lot of buyers, or believers that are also buyers," said Hugh Johnson, chairman of Johnson Illington Advisors.
"There is a number that believe we're not going to have a hard landing, that we're only in the middle of a soft landing and it won't last long," Johnson said.
The Dow Jones Industrial Average closed up 65.3 points, or 0.5%, at 13,232.5, with 20 of its 30 components closing higher.
The S&P 500 gained 9.08 points, or 0.6%, to 1,45498, while the Nasdaq Composite gained 21.57 points, or 0.8%, to 2,596.03.
Equities drew an early boost from the ECB's move Tuesday to make available more than $500 billion to boost liquidity in the banking system. .
On the New York Mercantile Exchange, crude-oil futures ended down 14 cents at $90.49 a barrel. .
In the metal pits, gold rallied 1% to close at $807.4 an ounce.
Volume on the New York Stock Exchange came to nearly 1.5 billion shares, and advancing stocks topped those falling more than 5 to 3. On the Nasdaq, almost 2 billion shares were exchanged, and advancing shares edged ahead of those advancing by 3 to 1.
Goldman Sachs reported fourth-quarter net income rose 2% from a year ago, with profit topping Wall Street estimates for an eighth straight quarter. Its stock, however, fell 3%.
In its forecast, Goldman Sachs "failed to offer any reassuring words about the outlook for 2008," said Frederick Ruffy, an analyst at Optionetics.
The government reported new single-family home construction slowed to its weakest pace in 16 years in November, with starts down 5.4% to a seasonally adjusted annual rate of 829,000. .
"For the second month in a row, the volatile multi-family starts category was strong, while single-family groundbreaking activity sagged," said Stephen Stanley, chief economist at RBS Greenwich Capital.
In a related development, the Federal Reserve is proposing rules aimed at heading off another lending crisis like the one that hit the subprime-mortgage industry. .
Shares of Best Buy gained 0.9% after the company said third-quarter profit climbed to 53 cents a share from 31 cents a year earlier, exceeding forecasts.
Adobe Systems Inc. shares were up 2.1% after the software maker late Monday reported strong fourth-quarter profit and sales that mostly topped analysts' estimates. .
In Europe, shares recovered a bit as investors moved back into banks as central banks moved to alleviate turmoil in the credit market. .
Asian stocks took a mostly upbeat course, with markets in Hong Kong and South Korea gaining and Japan's Nikkei 225 Average narrowing losses. .
On Monday, stock indexes fell to their lowest levels in more than two weeks on concern about U.S. economic growth.
By Kate Gibson