The Nasdaq composite index rose 241.86, or nearly 8 percent, to 3,316.54, and the Standard & Poor's 500 index climbed 44.35, or 3 percent, to 1,374.13.
The Dow Jones industrial average rose 157.60, or almost 2 percent, to 10,192.18.
The point increase was the third largest in Nasdaq history, and the percentage gain was the second highest.
Despite the gains, it was still a gloomy week for stocks, particularly many tech shares. The S&P closed down 4 percent from last week's close, while the Dow lost 2 percent and the Nasdaq shaved 1 percent.
"I'm surprised the markets didn't give anything back," said Bryan Piskorowski, a market strategist at Prudential who noted that the Nasdaq had fallen for seven consecutive trading sessions before today's pop.
"It's hard to read into one day, especially after the gut-wrenching trading we've seen the past few weeks," he said. "I'm not going to put any faith into it until we see some follow through."
Thursday, the Dow fell 379.21, or nearly 4 percent, and closed within 33 points of 10,000, a level it first passed in April 1999. The decline was the Dow's fifth-largest point drop in history. The Nasdaq closed down 93.81, or 3 percent, to 3,074.68 and set a new low for the year.
Crude-oil prices Friday fell for the first time in six sessions on hopes that world leaders will be able to bring Israeli and Palestinian leaders together for negotiations after two weeks of conflict.
Investors also had some new economic data to consider Friday. The Producer Price Index, a measure of prices at the wholesale level, gained 0.90 percent in September, the sharpest increase in seven months, led by big jumps in the costs of gasoline and heating oil. Car prices posted their biggest increase in five years, and food costs rose for the first time in five months.
Outside the volatile energy and food categories, the "core" rate of inflation at the wholesale level rose 0.30 percent in September, slightly faster than the 0.20 percent rise many analysts were expecting.
In another report, retail sales rose a stronger-than-expected 0.90 percent in September mostly reflecting strong car sales, which went up by 1.40 percent. Still, excluding automobiles, retail sales rose a brisk 0.70 percent.
The CNET tech index rose 193.86, or about 8 percent, to 2,652.14. For the first time in weeks, winners outnumbered losers, with 89 of the 97 stocks in the index rising and 8 falling.
Large-cap tech stocks led the Nasdaq higher. Intel rose $3.25 to $40.38; Cisco Systems climbed $6.25 to $56.06; and Oracle gained $4.13 to $35.63.
Earnings news helped and hurt some stocks. Shares of DoubleClick fell $5.69, or 31 percent, to $12.44 after the Internet-advertising company said late Thursday that ad sales will slow during the next six months and that its third-quarter loss widened.
Volume surpassed 52.8 million shares, more than 11 times the stock's average daily volume of 4.6 million shares.
After U.S. markets closed yesterday, the company said its third-quarter loss widened to $10.7 million, or 9 cents a share, from $136,000, or breakeven, a year ago.
Excluding amortization and noncash charges, DoubleClick would have earned 3 cents a share, matching the average estimate of analysts polled by First Call/Thomson Financial.
Investors treated shares of Gateway more kindly after the computer maker met Wall Street earnings expectations and boasted that it has been unaffected by the problems hitting its rivals.
Gateway shares rose $9.48, or almost 21 percent, to $53.11.
Juniper Networks rose $28.91, or 14 percent, to $228.51. The maker of Internet routers, reported a third-quarter profit as sales jumped more than sixfold, exceeding analysts' forecasts.
All of the 18 sectors tracked by CNET Investor posted early gains. Server hardware companies blazed the trail higher, rising 12 percent, followed by server-software developers, which gained nearly 11 percent.
Chip stocks also made strong gains. The Philadelphia semiconductor index rose 69.21, or 10 percent, to 758.32 led by chipmaker Altera, which gained $4.81, or 17 percent, to $32.94.
Chipmaker PMC-Sierra's shares rose $32, or 20 percent, to $190.44 after the communications-chip maker reported third-quarter profit and sales that beat analysts' forecasts, fueled by surging demand for Internet capacity.