The market also welcomed deal news from the Nasdaq Stock Market and Coca-Cola Co.
"The housing data was a little bit disappointing," said Robert Pavlik, chief investment officer at Oaktree Asset Management. "But it adds to the argument that the Fed may step in and cut interest rates later this year."
Trading volumes were thin ahead of the three-day Memorial Day weekend.
The Dow Jones Industrial Average gained 66 points to close at 13,507, as 24 of its 30 components advanced, led by Honeywell Inc. , Microsoft Corp. and Exxon Mobil Corp. and Alcoa Inc. .
For the week, however, the Dow fell 0.4%, after the market was rocked by concerns about Chinese stocks and the direction of interest rates.
"Investors still think stocks are the right place to be," said Joe Battipaglia of Ryan, Beck & Co., but "it looks like the market is getting very tired here," he told MarketWatch.
Deal news remained key in fueling the market's advance. Deals reduce the overall share count and lead investors to make bets on potential acquisition targets.
On Friday, Dow component Coca-Cola gained 1.3% after saying it's agreed to buy Energy Brands Inc., also known as Glaceau, for $4.1 billion. The acquisition will provide Coca-Cola with Energy Brands' enhanced water products, including the vitaminwater and smartwater brand.
The S&P 500 gained 8.2 points to close at 1,515. For the week, the broad index lost 0.5%.
The Nasdaq Composite rose 19.3 points to close at 2,557. It finished the week fractionally lower.
Nasdaq , which is also a listed company, dropped 3.3%. It said it would pay $3.7 billion for OMX. The U.S. exchange has been under pressure to find a partner following its failed bid for the London Stock Exchange and after rival the New York Stock Exchange completed a deal to buy Euronext, creating NYSE Euronext .
There were 1.2 billion shares exchanging hands on the New York Stock Exchange and 1.5 billion trading on the Nasdaq stock market. Advancing issues outpaced decliners by 22 to 9 on the NYSE and by 19 to 10 on the Nasdaq.
Resales of U.S. homes fell 2.6% in April to a seasonally adjusted annualized rate of 5.99 million, the slowest pace in four years. Economists were expecting sales of about 6.11 million, according to a survey conducted by MarketWatch.
Sales are down 10.7% since April 2006, and inventories of unsold homes have increased to 4.20 million, the largest supply in 15 years.
But investors were heartened by the possibility that the Fed may still step in to cut rates and boost the economy.
The market sold off on Thursday after news of an unexpected jump in new home sales sparked concerns about the direction of rates.
"You do want housing to turn around but you don't want to see it so strong that it brings back concerns about higher interest rates," said Oaktree's Pavlik.
The dollar fell back against the euro after the housing data, but it rose against the yen after a report that North Korea had fired several short-range missiles into the Sea of Japan.
Gold futures advanced, along with oil, adding $2 to close at $655.30 an ounce.
Oil prices firmed, with the July light crude contract adding $1.02 to close at $65.20 a barrel in electronic trading. Oil recouped some of its prior-session losses, as concerns over supply disruptions in Nigeria served to boost energy prices.
Bonds came off lows but remained weaker after the weaker-than-expected housing data. The benchmark 10-year Treasury bond finished down 3/32 at 97 6/32, yielding 4.859%.
Late Thursday, Gap Inc. poste a 26% decline in quarterly profit, hit by steep markdowns and a write-down related to store closures.
The New York Times reported that the Securities and Exchange Commission has started an inquiry into whether two Dow Chemical executives secretly tried to arrange a sale of the company.
Aeropostale late Thursday said first-quarter net income climbed 64% to $13.8 million, or 26 cents a share, from $8.36 million, or 15 cents a share, a year earlier. The New York clothing retailer said sales for the period ended May 5 grew 12% to $275.8 million.
Shares of Verigy were indicated up over 8% in the pre-open market after it swung to a profit of $22 million, or 36 cents a share.
Agilysys is expected to report fourth-quarter earnings of 24 cents a share.
By Nick Godt