The S&P 500 turned positive for the year on Friday as equities rallied again on a run of better-than-expected economic data, though volume continued to be seasonally weak.

The benchmark index has gained nearly 5 percent over its string of four straight winning days, putting it slightly higher for the year. Investors cited recent improvement in U.S. economic data and seasonal factors behind the move, but many remained cautious about the 2012 outlook.

New U.S. single-family home sales rose to a seven-month high in November and the supply of houses on the market was the lowest in 5-1/2 years. The data added to signs of a budding recovery in the sector, which continues to be a serious overhang for markets. Banks have been especially hard hit, with financials <.GSPF> the worst performing S&P sector this year.

The data have been improving, and that's leading to an improvement in investor sentiment, which is contributing to the more confident tone in the market, said Lawrence Glazer, managing partner at Mayflower Advisors in Boston.

Also, there's something psychologically significant in our turning higher for the year.

The S&P 500 edged above its 200-day moving average, a level that has proved difficult to maintain after plummeting below it in August. However, low holiday-season volume means investors are cautious of the move.

The U.S. Congress approved a two-month extension of a payroll tax cut for 160 million workers that otherwise would have expired on December 31. The resolution, if only temporary, removes a market headwind that investors said could have hit growth next year.

The Dow Jones industrial average <.DJI> was up 89.46 points, or 0.74 percent, at 12,259.11. The Standard & Poor's 500 Index <.SPX> was up 7.90 points, or 0.63 percent, at 1,261.90. The Nasdaq Composite Index <.IXIC> was up 15.16 points, or 0.58 percent, at 2,614.61.

Volume was light ahead of the extended Christmas holiday weekend, and could still spark exaggerated market swings. The New York Stock Exchange will observe normal trading hours, but the bond market closed early, at 2:00 p.m. EST (1900 GMT).

Brian Battle, a trader at Performance Trust Capital Partners in Chicago, warned about reading too much into the market's recent run. He said he was cautious heading into the new year, with Europe's debt crisis unresolved, growth still weak, and a U.S. presidential election looming.

We should all be careful not to deem it as the end, he said. We might take it all back in January.

SunPower Corp jumped 3.1 percent to $6.03 after the solar panels maker reached a deal to acquire rival Tenesol, a unit of France's Total SA . At the same time, Total is buying 18.6 million SunPower shares, raising its stake to about 66 percent.

Shares in Rambus Inc jumped 14 percent to $8.32. The company signed a patent licensing deal with Broadcom Inc , resolving all previous claims related to its technology.

WPX Energy Inc will replace Compuware Corp in the S&P 500 index, with Compuware replacing Exterran Holdings Inc in the S&P MidCap 400 index, Standard and Poor's said.

Exterran will replace Skyline Corp in the S&P SmallCap 600 index. The changes are effective at the close of trading on Friday, December 30.

Compuware fell 0.5 percent to $8.29, Exterran slid 3.8 percent to $9.18, and Skyline dropped 6 percent to $4.41.

(Reporting By Ryan Vlastelica; Editing by Jan Paschal)