Dow Logs 7th Straight Gain; Apple Slides

A late rally pushed stocks higher Tuesday following better-than-expected earnings from several Dow components.

The Dow Jones Industrial Averagerose 67.79, or 0.8 percent, to close at 8,915.04, its seventh straight gain. The S&P 500andNasdaqeach gained0.4 percent. It was the Nasdaq's 10th straight gain — its longest streak in 12 years.

The Dow had shot out of the gate this morning, after beats from several components, but pockets of weakness quickly began to emerge, including chips, hardware, banks and retail. All three indexes turned lower at midday as investors digested Fed Chairman Ben Bernanke's testimony on Capitol Hill, before a late rally propelled them to a positive finish.

"What we're seeing today is a combination of markets focusing on two things: the caution from companies, and the remaining hurdles the economy must work through before it reaches recovery," Subodh Kumar, chief investment strategist at Subodh Kumar & Assoc., told Reuters.

In his semi-annual testimony before the House, Bernanke repeated the Fed's projection that the economy will start growing again in the second half but cautioned that it would be modest growthand unemployment would continue to rise. He also said the Fed is working on an exit strategy to avoid having its stimulus measures cause a spike in inflation.

"The [Fed] has been devoting considerable attention to issues relating to its exit strategy, and we are confident that we have the necessary tools to implement that strategy when appropriate," he said, echoing comments he made in an op-ed in Tuesday's Wall Street Journal.

Bernanke will repeat his testimony tomorrow morning before the Senate.

Caterpillar was the biggest percentage gainer on the Dow, up 7.7 percent, after the construction-equipment manufacturer beat earnings expectations and raised its outlook.

A slew of other Dow components also beat, including Merck , Coca-Cola and DuPont.

Merck and Pfizer rounded out the Dow's top three.

The anomaly today: United Technologies narrowly beat expectations but lowered its full-year outlook. Its shares fell 1.8 percent.

Texas Instruments followed in Intel's footsteps, topping earnings expectations when it reported after the bell Monday. Still, TI shares dropped 2.3 percent.

After the bell today, reports are due out from Apple , Advanced Micro Devices , Starbucks and Yahoo .

Regions Financial shed more than 15 percent and Comerica , more than 10 percent, after the regional banks posted second-quarter losses and reported an increase in bad loans amid problems in the commercial real-estate market.

CIT Grouptumbled more than 10 percent after the lender said it may have to seek bankruptcy if enough notes aren't tendered by its deadline. The stock had more than tripled since touching an all-time low of 31 cents a share last Thursday amid buzz that it had had reached an agreement for emergency funding from bondholders. CIT formally announced the agreement Monday evening.

Even Apple was lower ahead of its earnings tonight, which are expected to dazzle once again. CNBC's Jim Goldman will be live-blogging the conference call, which is slated to start at 2 pm PT/5 pm ET, on his Tech Check blog.

Still to Come:

It's a jam-packed week of earnings, with about a third of the S&P — and half the Dow — reporting.

TUESDAY: Earnings from Apple, Yahoo, AMD and Starbucks after the bell
WEDNESDAY: Weekly mortgage applications; weekly crude inventories; Earnings from Boeing, Glaxo, Morgan Stanley, Pepsi, Pfizer, Wells Fargo, Bank of NY Mellon; Delta; KeyCorp; SunTrust, US Bancorp, Qualcomm, eBay and Sandisk
THURSDAY: Weekly jobless claims; existing-home sales; Earnings from AT&T, Bristol-Myers Squibb, Ford, MMM, CIT Group, Fifth Third, PNC Financial, UPS, Xerox, Amazon, AmEx, Microsoft, Broadcom and Capital One
FRIDAY: Earnings from Ericsson, Ingersoll-Rand, Schlumberger; Red Hat replaces CIT in S&P 500 after the closing bell

Send comments to cindy.perman@nbcuni.com.