"IBM is helping a lot," said Al Goldman, chief market strategist at AG Edwards. "The market is once again showing there is a lot of money on the sidelines and a lot of folks want in."
The Dow Jones Industrial Average gained 75 points to 13,991, as 18 of its 30 stocks advanced, led by the likes of Hewlett-Packard , Altria , Alcoa Inc. and American Express .
The blue-chip average crossed the 14,000 mark for the first time on Tuesday, punching in a record high of 14,022.
Leading the Dow's advance, IBM gained 4%, after reporting its strongest quarterly performance since 2002, with its profit up 12% led by sales of IT services to corporations.
On the downside, Honeywell International Inc. , another Dow component, fell 0.9%, even after posting stronger-than-expected earnings and lifting its 2007 guidance. The stock touched a 52-week high on Tuesday.
The S&P 500 index gained 8 points to 1,554, while the Nasdaq Composite rose 22.3 points to 2,721.
On the New York Stock Exchange, 716 million shares exchanged hands, while more than 1 billion were traded on the Nasdaq. Advancing issues beat decliners 2 to 1 on the NYSE and by 8 to 5 on the Nasdaq.
By sector, transportation , technology and insurance stocks were among those advancing, while financial services and banking stocks led the declines.
Software firms also received a lift after Germany's SAP said its profit rose a stronger-than-forecast 8%, helped by a low tax rate and market share gains. Its shares jumped 7%.
Shares of Juniper Networks Inc. also helped lift the tech sector, jumping almost 12% after Goldman Sachs upgraded the stock to buy from neutral. The broker said Juniper's new routing products should help it regain some of the market share it has lost to Cisco Systems Inc. .
Meanwhile, EBay Inc. fell 1.5% after reporting that its global listings fell 6%, offsetting the 50% profit rise it posted for the second quarter.
Google and Microsoft , both of which report earnings after the close, were also in focus.
Financial shares, the most influential sector in the market, slumped for a second consecutive day, as subprime worries reentered the market, with Standard & Poor's downgrading more mortgage-backed securities. The agency on Thursday cut ratings on 418 classes of residential mortgage-backed securities, saying losses would "significantly" exceed its expectations.
Goldman Sachs Group Inc. declined 1.4%; Morgan Stanley nearly 1.4%; and Merrill Lynch & Co. Inc. descended 1%.
And, in a second day of congressional testimony, Federal Reserve Chairman Ben Bernanke added his voice to the mix, predicting "significant losses" from subprime mortgage paper.
Also adding fuel to the subprime fire was a forecast that the economy is due to retract in coming months, in part due to an ongoing slowdown in the housing sector. The Conference Board's Index of Leading Economic Indicators declined 0.3%, a larger drop than anticipated.
On Wednesday, the market ended lower amid jitters over the impact of subprime mortgages and the two now nearly worthless Bear Stearns funds that had invested heavily in them.
Large banks also fell after an analyst downgraded several of them, saying they weren't shielded from the meltdown in the subprime mortgage market.
But financials advanced on Thursday, helped after Bank of America posted a better-than-forecast 5% profit rise. Online broker TD Ameritrade , meanwhile, lifted its earnings guidance for the year.
With investor focus set on earnings, crude oil prices above $75 haven't yet set off any concerns about rising costs for U.S. consumers and busnesses. Instead, the energy sector, has lent a helping hand to the market.
On Thursday, Crude oil futures neared $76 a barrel.
"Investors are willing to tolerate higher rates and higher oil prices if the cause is expanding economic growth," said Marc Pado, market strategist at Cantor Fitzgerald. "They are a little less happy if we have to deal with these issues and face an economy still languishing below trend."
The dollar traded mixed against other major currencies, the euro at $1.317 vs. $1.3795 late Wednesday. The dollar was quoted at 121.99 yen, compared with 121.93 yen.
Treasury prices fell, with the 10-year note down 5/32 at 95 24/32, its yield climbing to %.056%.
In other earnings news, Continental Airlines said it posted its best profit before tax since 2000.
Motorola Inc. swung to a small loss in the second quarter as sales of mobile phones deteriorated in Asia and Europe.
Elsewhere, PepsiCo may also attract attention on a report from The Wall Street Journal that it held merger talks with Nestle that collapsed due to the Swiss food giant's reluctance to pair with a firm that generated the bulk of its sales from potato chips and soda.
By Kate Gibson