Stocks rose on low volume on Thursday as data showed improvement in housing and the job market a day ahead of the critical monthly payrolls figures.

Investors built on Wednesday's sharp advance as indicators provided the latest reason for optimism the economy could avoid another downturn. But the nascent rally could be derailed if Friday's jobs data disappoints investors.

Money seems to be flowing out of bonds and into the stock market, said Ryan Detrick, senior technical strategist at Schaeffer's Investment Research in Cincinnati.

Obviously, tomorrow comes the big news with the employment data. But in the near term, it shows how explosive rallies can be when we get decent economic data, because the market is pricing a double-dip recession.

Chipmaker shares rose for a second day running and the PHLX semiconductor index <.SOX> gained 2.1 percent to close above its 14-day moving average for the first time since late July.

Broadcom Corp , up $1.63 at $32.71, posted a 9.2 percent advance in the last two sessions, its largest such gain since May 2009.

The Dow Jones industrial average <.DJI> added 50.63 points, or 0.49 percent, to 10,320.10. The Standard & Poor's 500 Index <.SPX> rose 9.81 points, or 0.91 percent, to 1,090.10. The Nasdaq Composite Index <.IXIC> gained 23.17 points, or 1.06 percent, to close at 2,200.01.

About 6.6 billion shares traded on the New York Stock Exchange, the Nasdaq and the American Stock Exchange, about average for the past month, but still way below last year's daily average of 9.65 billion. Volume is typically light in the days just ahead of the Labor Day holiday weekend.

The housing and labor markets have long been considered two of the biggest headwinds the economic recovery faces. Friday's payrolls report is expected to show about 100,000 jobs were lost in August.

Data from the National Association of Realtors showed pending home resales rose unexpectedly in July and a separate report showed new claims for unemployment insurance fell for a second straight week.

Shares of Hovnanian Enterprises rose 5.4 percent to $3.88 on the home sales data and after the sixth-largest U.S. builder reported a narrower quarterly loss late on Wednesday.

Homebuilders, semis are doing well, the riskier trade is kind of back on, said Detrick.

The biggest open interest on an ETF that tracks the S&P 500 was at September $109 on the call side and September $110 on the put side. Since the SPDR S&P 500 was at 109.47, the open interest suggests options investors are not expecting a major move after the payrolls report.

The S&P 500's moving average convergence-divergence or MACD generated a 'buy' signal after having been a 'sell' since August 11. The last time the signal turned bullish was July 9, foreshadowing an advance that ended a month later and made July the best month for the index in a year.

At least in the near term, that's a sign things are improving. That's usually the first step. We need that positive MACD for bigger future gains, Schaeffer's Detrick said.

The Morgan Stanley Retail index <.MVR> rose 2.4 percent and Nordstrom Inc jumped 8.1 percent to $32.76 as U.S. retailers posted better-than-expected sales in August.

Today's data is positive, but given the high level of unemployment, it's hard to be too optimistic about the consumer, said Michael Sheldon, chief market strategist at RDM Financial in Westport, Connecticut.

Burger King Holdings Inc agreed to sell itself to investment firm 3G Capital for about $3.26 billion, pushing the stock up 25.1 percent to $23.59.

In the end to an extended bidding war, Hewlett-Packard Co raised its buyout offer for data storage company 3PAR Inc
to $33 a share, topping an earlier bid from Dell Inc . The higher bid prompted Dell to bow out.

Shares of 3PAR rose 2.5 percent to $32.88 while Dell gained 2 percent to $12.36.

HP, a Dow component, rose 1.2 percent to $39.68.

Advancing stocks outnumbered declining ones on the NYSE by a ratio of about 7 to 3, while on the Nasdaq, about eight stocks rose for every five that fell.

(Reporting by Rodrigo Campos; Additional reporting by Ryan Vlastelica and Angela Moon; Editing by Jan Paschal)