Stocks rose on Tuesday as investors welcomed a slew of corporate results and as a decline in borrowing costs for Spain eased concerns about Europe's debt crisis.

Coca-Cola Co , Goldman Sachs Group Inc and Johnson & Johnson all posted profits that beat analyst forecasts and lifted expectation for earnings in general. Of the 39 S&P 500 companies reporting earnings so far, 74.4 percent have beat analyst expectations, according to Thomson Reuters data.

Expectations were fairly low coming into first-quarter earnings season, and so far, the news has been surprisingly good, said Mark Luschini, chief investment strategist at Janney Montgomery Scott in Philadelphia.

We are accumulating some evidence that one, earnings are matching or exceeding expectations, and two, even in light of what's going on in Europe and the trepidation with regard to global growth, companies are able to continue to respond positively in terms of profitability.

Although not all the shares of reporting companies rose, the results helped ease fears that earnings could start to tail off this quarter.

Better-than-expected results from Spanish 12-month and 18 month bill sales pushed yields on Spain's 10-year bond below 6 percent, but a longer-term debt auction later in the week could be a more telling test. Spanish debt yields have jumped recently on concerns about the nation's fiscal stability.

The Dow Jones industrial average <.DJI> gained 147.59 points, or 1.14 percent, to 13,069.00. The Standard & Poor's 500 Index <.SPX> added 15.17 points, or 1.11 percent, to 1,384.74. The Nasdaq Composite Index <.IXIC> rose 40.61 points, or 1.36 percent, to 3,029.01.

The S&P 500 continues to trade around its 50-day moving average after sinking below that level for the first time in more than 3 months last week. The level, currently at 1,377.35, is closely watched by traders.

Coca-Cola climbed 2.7 percent to $74.35 as one of the top boost's to the Dow industrials after the world's largest soft drink maker reported a higher quarterly profit.

Goldman Sachs edged up 0.1 percent to $117.89 after first-quarter earnings fell from a year earlier but were better than many analysts had anticipated.

Earnings are coming in well enough to support the market and stabilize any significant downdraft. Spain specifically with the 10-year yield topping 6 percent, that is a headline that really instills fear into the market. said Peter Kenny, managing director at Knight Capital In Jersey City, New Jersey.

Johnson & Johnson shares slipped 0.2 percent to $63.85 after posting a higher-than-expected quarterly profit as revenue fell slightly.

This week, 86 S&P 500 companies are scheduled to report results.

Economic data in the United States was mixed as groundbreaking on homes fell unexpectedly in March, but permits for future construction rose to their highest level in 3 1/2 years. The PHLX housing index <.HGX> gained 1.6 percent.

A Federal Reserve report showed industrial output was flat for a second straight month in March, held back by a drop in manufacturing, and capacity utilization, a measure of how fully firms are using their resources, fell to 78.6 percent from 78.7 percent in February.

International Business Machines Corp reports earnings after the bell on Tuesday, and investors are hoping strong software demand will make for a repeat of last year's first-quarter performance, when the company raised its full year forecast.

A unit of Toshiba Corp <6502.T> is in talks to buy IBM Corp's point-of-sale terminal business, which includes cash registers, a source familiar with the deal said on Tuesday. IBM shares gained 1.2 percent to $205.18 to lead the Dow.

Yahoo Inc is also due to unveil earnings after the close, but the report may be overshadowed by comments from its new chief executive, Scott Thompson, who is expected to lay out his vision for the struggling web pioneer. Shares gained 2.1 percent to $15.09.

Apple Inc shares gained 2.4 percent to $594.21, putting shares of the iPad maker on track to snap a 5-day losing streak, which sent shares down 8.8 percent.

(Editing by Padraic Cassidy)