Blue chips finished higher for a third straight session after an unexpected increase in January retail sales. Technology stocks rallied after chip-equipment maker Applied Materials beat earnings forecasts.
The tech-heavy Nasdaq gained more than 2 percent. The Dow Jones Industrial Average and broader S&P 500 index rose more than 1 percent.
Applied Materials, the top gainer on the S&P, rose more than 10 percent after the company beat earnings expectations despite reported drops in both earnings and revenue. The company admitted that the IT-spending slowdown has hurt business but offered a glimmer of hope: Demand for chips used in flat-screen TVs and computer screens is strong.
Blue-chip techs Microsoft and Hewlett-Packard were among some of the biggest gainers on the Dow. Among other big-name techs, Apple jumped more than 3 percent.
Alcoa was the biggest gainer on the Dow. The rumor mill is churning speculation that the aluminum giant may be a takeover target and that Rio Tinto or BHP Billiton may be the buyer, Bob O'Brien wrote on his "Stocks to Watch" blog on Barron's.com. Curiously, yesterday, BloggingStocks.com had a post citing a reader, who asked why, in all of the mining merger mania, no one was buying Alcoa, which is very cheap right now.
The buzz about Yahoo grew louder following news that it's in talks with News Corp. to combine MySpace and other online properties owned by News Corp. with Yahoo.
Earlier, Yahoo's second-largest shareholder urged Microsoft to raise its $44.6 billion offerand said that, ultimately, it will be hard for Yahoo to resist any offer Microsoft makes. Meanwhile, reports suggested that Google may be losing interest in any alliance or deal with Yahoo.
Retail sales were the reason du jour for investors to bid up the broader market.
Retail sales rose 0.3 percentlast month from December, largely reflecting increases in sales of new cars and gasoline. Economists had expected the gauge to drop by 0.4 percent. Excluding autos, gasoline and building materials, retail sales climbed 0.2 percent.
"As much as people want to get excited about this number, the same theme is there, which is that the U.S. consumer is slowing rapidly from the fourth quarter into the first quarter," Drew Matus, an economist at Lehman Brothers, told CNBC. "The rest of the first quarter is probably not going to look so great."
"The headline [retail] number doesn't account for promotional activity," David Turner, a retail analyst with BB&T Capital Markets, told CNBC. "Sales may look good, but I don't think the profits are following suit."
The rally was likely due to the fact that the market was expecting retail sales to decline, which would've been the second straight month-to-month drop, something that hasn't happened in five years that would suggest that the economy was slipping into recession.
Retail analysts still have some picks in the sector. Turner likes Pacific Sunwear, Skechers and City Trends, all based on valuations.
Charles Grom, a retail analyst at J.P. Morgan, is long Costco -- which has a 55 percent mix of food in its product line -- and J.C. Penney. He told CNBC that he thinks the department stores are headed for a rally. Grom is underweight on Family Dollar, Dollar Tree and Wal-Mart because they're "value traps" that are already up about 20 percent.
Elsewhere in retail, Sears Holdings said it's cutting 200 support-function jobs, which represents about 4 percent of its headquarters staff. The operator of the Kmart and Sears chains last month warned that fourth-quarter profit would decline amid a drop in holiday sales. The company let its CEO go last month and billionaire investor Eddie Lampert has come under fire for failing to turn around the struggling retailer after engineering the Kmart-Sears merger.
Blue Nile skidded after the online diamond jeweler late Tuesday issued a disappointing earnings forecast.
Treasury Secretary Henry Paulson offered the market some encouragement, repeating his view that the U.S. economy will avoid recession this year, though it will grow at a slower pace. He also said that Treasury will act quickly to distribute tax rebates.
However, Paulson said he thinks the markets have not yet digested the full effects of the housing downturn.
In other economic news, business inventories swelled by a larger-than-expected 0.6 percent in December as sales declined but the stock-to-sales ratio shrunk from a year earlier. The Mortgage Bankers Association reported its seasonally adjusted home-loan-application index fell 2.1 percent in the week ended Feb. 8 to 1,063.5, after hitting a peak in the prior week.
UnitedHealth and other insurance stocks tumbled following news that New York Attorney General Andrew Cuomo said he has issued 16 subpoenas to health-insurance companies, including Aetna, Cigna and WellPoint's Empire Blue Cross Blue Shield.
Exxon Mobil rose after Venezuela on Tuesday said it was cutting off oil shipments to the company. Rival ConocoPhillips is also in a dispute with Venezuela.
Oil prices ticked higher after a report showed that U.S. inventories of crude oil and gasoline rose less than expected last week.
On the earnings front, Dow component Coca Cola reported a higher-than-expected profit, as the soft-drink giant offset weak sales of Coca-Cola and Sprite with strong sales in emerging markets, acquisitions of noncarbonated drinks including Vitaminwater, and the introduction of Coke Zero, a no-calorie version.
Tractor maker Deere also surpassed expectations as soaring crop prices boosted demand for agricultural equipment.
Shares of alternative-energy company First Solar surged more than 27 percent after the maker of thin-film solar equipment eclipsed earnings expectations.