In midday trading, the Nasdaq composite index rose 104.32, or nearly 3 percent, to 4,159.95. The Standard & Poor's 500 index climbed 12.98 to 1,494.94. The Dow Jones industrial average rose 127.72 to 10,823.80.
IBM led the Dow higher, rising $5.13 to $113.88. The company today reported earnings per share of $1.06, compared with the $1 projected by analysts surveyed by First Call/Thomson Financial. Revenue declined 1 percent to $21.7 billion.
Before today's rebound, mixed earning news restrained sentiment and gave investors few reasons to buy stocks in earnest.
"Companies that improved in earnings saw some profit-taking over the prior two days, and companies that missed were taken out and shot immediately," said Bill Meehan, chief market analyst at Cantor Fitzgerald.
But Meehan said today's optimism isn't irrational. "Traders are still cautious," he said. "They are willing to trade around rather than stand still" on their market positions.
Federal Reserve Chairman Alan Greenspan gave a positive outlook on the state of the economy in a speech before members of Congress.
Greenspan said consumer spending appears to be slowing. The slowdown, if it continues, will decrease demand levels, which in turn takes pressure off of inflation. That means an interest rate hike to control inflation will be unlikely.
But the speech was not entirely rosy. Greenspan said that it is much too soon to conclude that the economy will run smoothly without further maintenance, and he reminded investors that interest rate hikes will happen if conditions deteriorate.
The CNET tech index climbed 49.96 to 2,979.68. Advancers raced ahead of decliners, with 71 of the 97 stocks in the index rising and 26 falling.
Of the 18 sectors tracked, server software developers posted the steepest gains, rising about 4 percent. Telecom equipment makers were the day's biggest sliders, falling 2 percent.
Earnings news pulled shares of Lucent Technologies, Citrix Systems, Qualcomm and Conexant Systems lower.
Lucent fell $9.75, or 15 percent, to $54.75 after the company reported better-than-expected third-quarter earnings but warned of weaker growth ahead.
Citrix dropped $3.56, or 16 percent, to $18.56 after the company said second-quarter income fell 46 percent to $15 million.
Conexant shares dropped $10.66, or almost 22 percent, to $38.28 after the company reported a third-quarter loss and announced it would buy two privately held companies for $285 million.
JDS Uniphase increased $16.94, or about 16 percent, to $123.69. The company will replace Rite Aid on the S&P 500 as of July 26. Shares of SDL, a company that JDS plans to acquire, rose $50.56, or 14 percent, to $410.19.
Investors forgave negative earnings news from Extreme Networks. The company reported an 80 percent drop in fourth-quarter income, but it also set a 2-for-1 stock split. Shares of the network equipment maker rose $20.25, or 17 percent, to $136.25.