The Dow Jones industrial average climbed as much as 29 points just after the market opened, then pulled back after the home sales report was released at 10 a.m. EDT. By early afternoon, it was up 19 points, or 0.1 percent, at 14,983.
Microsoft, which is part of the 30-member Dow, surged as much as 8 percent after CEO Steve Ballmer said he will retire within the next 12 months. Ballmer took the helm of the software company from founder Bill Gates in 2000. The company has struggled to adapt as consumers switch from desktop computing to mobile devices.
Other stock indexes also rose. The broader Standard and Poor's 500 index edged up four points, or 0.2 percent, to 1,660.
The Nasdaq composite rose 12 points, or 0.3 percent, to 3,651. The Nasdaq stock exchange was closed for most of the afternoon Thursday due to a technical glitch.
Traders reacted to the drop in home sales by buying bonds and gold, investments that become more attractive when the economy appears weaker.
The yield on the 10-year Treasury note declined to 2.82 percent from 2.89 percent late Thursday. The price of gold rose $25, or 1.8 percent, to $1,395 an ounce, the highest in two months.
Stocks have sagged in August on concerns that the Federal Reserve will start to pull back on its economic stimulus. The Fed has been buying $85 billion in bonds every month to hold down long-term interest rates and encourage lending.
Minutes from the Fed's July meeting released on Wednesday failed to give investors any clear indication of when the central bank will start easing its bond purchases.
The stock market may become more volatile in the coming weeks as traders try to anticipate the timing of the Fed's move, said Randy Frederick, managing director of active trading and derivatives at the Schwab Center for Financial Research.
Investors will also start to follow the debt ceiling debate in Washington more closely, he said. The U.S. stock market plunged in the summer of 2011 when policy makers wrangled over lifting the borrowing limit and pushed the country closer to default.
"The softening we are seeing in the market, and the rise in interest rates, these are all in anticipation of these issues," Frederick said. "Overall, I like the outlook for the rest of the year, I just don't like the next four to six weeks."
The S&P 500 has fallen 3 percent from its record close of 1,709 on Aug. 2, but remains up 16 percent for the year. The Dow fell for six straight days through Wednesday, its longest losing streak of 2013. It's still up 14 percent for the year.
Some analysts think investors won't wait that long, and will see the summer slump as an opportunity to buy stocks at less expensive prices, said Joe Bell, a senior equity analyst at Schaeffer's Investment Research.
"It's getting more attention in the mainstream," said Bell. "People are buying this pullback right now."
Among other stocks making big moves:
Microsoft rose $2.24, or 6.9 percent, to $34.63 after Ballmer's retirement was announced.
Pandora Media, the online music streaming company, slid $2.62, or 12 percent, to $19.10 after the company issued a disappointing profit outlook for the current quarter.
Aeropostale slid $2.14, or 20 percent, to $8.75 after the teen retailer reported dismal quarterly results and issued a pessimistic outlook. Several other teen retailers including Abercrombie & Fitch and American Eagle Outfitters have also reported poor customer traffic and slumping sales.