Investors also looked positively for the coming week, with firm expectations that the Federal Reserve will cut interest rates again.
"Earnings, more from the technology sector than anywhere else, have been very good, and the fact that the Fed is cutting rates" is lifting sentiment, said Paul Nolte, director of investments at Hinsdale Associates.
The Dow Jones Industrial Average rallied 134 points to 13,806, to end near its highs of the session. For the week, the Dow posted a gain of 2.1%.
Among blue chips, Microsoft jumped 9.5%. Late Thursday, the software giant posted a surprisingly strong quarterly profit, boosted by sales of the Vista operating system and the "Halo 3" video game.
The S&P 500 Index gained 20 points to 1,535. For the week, the broad index advanced 2.3%.
But most of gains were seen in the tech-heavy Nasdaq Composite Index , which rallied 53 points, or 1.9%, to 2,804. For the week, the Nasdaq rose 2.9%.
"Nasdaq [is] leading the way," said Peter Cardillo, chief market economist at Avalon Partners. "It's about earnings today."
Trading volumes showed 1.4 billion shares exchanging hands on the New York Stock Exchange and 2.5 billion shares trading on the Nasdaq market. Advancing stocks topped decliners by 23 to 8 on the NYSE, and by 19 to 10 on Nasdaq.
Oil topped $92 at one point to a new record, and gold reached 28-year highs as the dollar slumped to record lows, helping boost commodities-related stocks. Read and
Highlighting the market's leading sectors, strong gains were seen in the Amex Computer Technology Index , and the Amex Morgan Stanley Hi Tech index , along with the Amex Oil Index and the Amex Broker/Dealer Index .
On the downside were airlines and transportation stocks .
Countrywide sees profit
Shares of Countrywide , the nation's largest mortgage lender, jumped 32% after the largest U.S. mortgage lender posted a wider-than-forecast loss of $1.2 billion, but said that it would return to profitability in the fourth quarter.
Separately, the New York Times reported that Merrill Lynch Chief Executive Stan O'Neal discussed with Wachovia Corp. the possibility of merging -- without first getting the Merrill board's consent to do so. The move so enraged the board that they began discussing possible replacements, the report said.
Arkansas Best Corp. , the freight-transportation company, reported a 40% profit decline during the third quarter, blaming a weaker economy among other factors.
But Kimco Realty Corp. edged past estimates for funds from operations, in what could be an indicator of the health of the commercial real-estate market.
Oil lends a hand
The energy sector also lent a hand to the market, with crude futures touching a new record high of $92.22 overnight. Crude finished up $1.40 at $91.86, a new record close, on the New York Mercantile Exchange. Oil was boosted by concerns over dwindling U.S. inventories, Mideast tensions and a weak dollar.
Over the past week, the market has begun pricing in expectations that the Federal Reserve will cut interest rates next week to bolster the U.S. economy, which is working through the slumping housing market and related troubles in credit markets.
Earlier, the University of Michigan said its consumer-confidence index fell to 80.9 in October from 83.4 in September.
Expectations of lower rates have again hit the dollar, which hit another record low against the euro overnight. The euro was recently up 0.4% at $1.4381 near a record $1.4392.
A weak dollar in turn helps the price of dollar-denominated commodities, such s crude and gold. Gold futures also rallied $16.60 an ounce to $787.50 an ounce, a 28-year high.
Commodities-related shares also rose, with the Amex Oil Index up 2.1%, led by the likes of Valero Energy Corp. . Metals mining shares also rose, with the Amex Gold Bugs Index gaining 2.8%, led by the likes of Kinross Gold Corp.
By Nick Godt