NEW YORK ( TheStreet) -- Stocks finished higher Tuesday afternoon, helped by energy, materials and consumer cyclical names, as investors awaited a bevy of corporate earnings news due after the closing bell. The major market averages recovered from a morning slide, itself powered by a mix of tepid earnings and lingering disappointment from IBM's ( IBM) revenue miss late Monday.

After falling more than 100 points earlier in the session, the Dow Jones Industrial Average finished 76 points higher, or 0.7%, to 10,230. The S&P 500 added 12 points, or 1.1%, at 1083, and the Nasdaq improved 24 points, or 1.1%, to 2222.

After the closing bell, Apple ( AAPL) blew past both profit and sales projections for the third-quarter, saying it nearly doubled total revenue compared to a year ago after selling 8.4 million iPhones.

Yahoo! ( YHOO) also beat profit projections late, topping the consensus by a penny in reporting earnings of 15 cents a share for the second quarter. But the Internet search giant reported weaker-than-expected revenue, continuing a trend seen in other earnings releases this season.

Quincy Krosby, chief market strategist at Prudential Financial, said the market likely made an afternoon move higher in anticipation of post-closing news.

"It's been an up-and-down market. The market just changes moods," Krosby said before the close, highlighting growing strength among consumer cyclical names during the session. "It's clear the market was able to take some of the numbers today and just basically move ahead. And it could also be that the market is beginning to look ahead to the after-hours reports and move in now ahead of those."

Earlier, Goldman Sachs ( GS) topped expectations with an adjusted second-quarter profit of $2.75 a share, or 75 cents higher than analysts' forecasts. Including a $600 million U.K. bank payroll tax and the $550 million agreement it reached last Thursday to settle civil fraud charges brought by the Securities and Exchange Commission, net earnings were $613 million, or 78 cents a share. Revenue, meanwhile, dropped to $8.84 billion from $13.7 billion last year and fell short of expectations for revenue of roughly $9 billion. But Goldman shares traded higher, gaining $3.23, or 2.3%, to $148.91.

Mike Shea, managing partner at Direct Access Partners, said markets are eager to get a better sense of where financials are headed.

"There's still a strong sentiment that financials and banks are driving the bus -- and certainly tech as well -- so there's a strong focus on the financial sector," Shea said. "So far, from Bank of America ( BAC), JPMorgan ( JPM), Citi ( C) and now Goldman, we see that average trading revenues are down something like 30%-40%. We're still waiting on results from Morgan Stanley ( MS) results and a slew of other banks and smaller financials so we're going to have to get some sort of reading on where the financials are going," he said. "That's really what markets are interested in."

IBM was the Dow's biggest laggard with shares losing 2.5% to $126.55 despite surpassing profit expectations by 3 cents with earnings of $2.61 a share. Sales of $23.7 billion missed the $24.17 billion in sales that Wall Street had been anticipating.

Also after Monday's close, Texas Instruments said strong demand helped sales jump 42% to $3.5 billion while earnings grew threefold to 62 cents a share, but shares slipped in after-hours trading after profits met but failed to exceed expectations. Shares slipped 3.1% lower Tuesday to $24.77.

On Tuesday, the Bank of Canada lifted rates by 25 basis points to 0.75%, as expected, but struck a surprisingly dovish tone its statement that said additional increases would be "weighed carefully" because of the uncertain economic outlook.

Overseas on Tuesday, Hong Kong's Hang Seng rose 0.9%, and Japan's Nikkei lost 1.2%. The FTSE in London shed 0.2%, and the DAX in Frankfurt dropped 0.7%.

The Economy

The Department of Commerce said housing starts declined 0.5%, to 549,000 in June, which was the lowest level since October, and well below the level of 575,000 that economists had been projecting. June building permits, however, unexpectedly jumped 2.1%, to 586,000, exceeding the 572,000 permits that Wall Street had been anticipating.
Construction

Late in the day, the American Petroleum Institute said oil inventories dropped by 241,000 barrels last week, according to Bloomberg. Analysts polled by Platts were projecting that crude stockpiles declined by 1.6 million barrels in the week ended July 16.

Company News

BP ( BP) said it entered into a deal to sell multiple upstream assets across several locales to Apache ( APA). In a press statement released late Tuesday, BP said the asset sale deals are worth $7 billion in total and will be used to help pay costs from the Gulf oil spill.

Johnson & Johnson ( JNJ), which lowered its full-year earnings guidance because of its many drug recalls this year, had the weakest performance on the Dow after IBM. The consumer and health products company reported net earnings of $1.21 a share, which didn't include an after-tax gain of $67 million related to litigation matters. Sales rose 0.6% to $15.3 billion. Wall Street estimates, which typically exclude special items, were for a profit of $1.21 a share and sales of $15.6 billion. Shares traded 1.7% lower at $58.58.

Shares of Home Depot ( HD) and Wal-Mart ( WMT) led the blue-chip average into positive territory.

Steel Dynamics ( STLD) swung to a profit in the second quarter, but earnings of 22 cents a share weren't enough to surpass the profit of 25 cents a share that analysts had been forecasting. Sales, meanwhile, more than doubled, to $1.6 billion.

Higher investment management and servicing fees helped State Street ( STT) swing to a profit in the second quarter, meeting Wall Street estimates for a profit of 93 cents a share.

Shares of Bank of New York Mellon ( BK) shed 0.4% after the company's second-quarter net income from continuing operations came in a penny shy of analysts' estimates.

Pepsi's ( PEP) earnings missed estimates in the second quarter, but sales of $14.8 billion exceeded forecasts for sales of $14.4 billion. The company also maintained its earnings per share growth target of 11% to 13% for the full year from its 2009 core EPS of $3.71. Shares gained 4.3% at $64.73.

UnitedHealth ( UNH) reported a 31% jump in second-quarter earnings to $1.12 billion, or 99 cents a share, easily outpacing estimates of 75 cents a share. The company credited growth in its health benefits and health services operations. UnitedHealth also increased its year-end profit outlook to a range of $3.40 to $3.60 a share. The stock added a penny to close at $30.83.

Harley-Davidson ( HOG) easily beat estimates with a profit of 59 cents a share, or 18 cents higher than what analysts had been forecasting. Sales of $1.14 billion also surpassed expectations for second-quarter revenue of $1.11 billion.

Commodities and the Dollar

Crude oil for August delivery settled 90 cents higher, at $77.44 a barrel.

Elsewhere in commodity markets, the August gold contract traded up $9.80 to settle at $1,191.70 an ounce.

The dollar was trading higher against a basket of currencies, with the dollar index up by 0.2%.

Treasuries

The benchmark 10-year Treasury was up 4/32, diluting the yield to 2.950%.

The two-year note rose a fraction, dropping the yield to 0.589%. The 30-year bond was advancing 1/32, downing the yield to 3.982%.

--Written by Melinda Peer and Sung Moss in New York.