U.S. stocks advanced in a thinly traded session on Wednesday with the S&P 500 eyeing its best December in nearly two decades as investors remained optimistic about the prospects for equities next year.

The S&P 500 has gained 6.7 percent so far this month and has risen in 17 of the last 20 sessions. However, with volume around the holidays registering some of the lowest levels of the year, some investors are waiting for January to see if the trend holds.

People are hoping that the consumer is back and that will help fuel the engine and grow some earnings so that companies will start hiring, said Frank Ingarra, a portfolio manager at Hennessy Funds in Stamford, Connecticut. The next quarter will be the interesting quarter. Does the euphoria from Christmas and the holidays carry forward or not.

The Dow Jones industrial average <.DJI> gained 23.42 points, or 0.20 percent, to 11,598.96. The Standard & Poor's 500 Index <.SPX> rose 2.31 points, or 0.18 percent, to 1,260.82. The Nasdaq Composite Index <.IXIC> added 4.70 points, or 0.18 percent, to 2,667.58.

The S&P 500 has risen above levels reached on September 12, 2008, the last trading day before Lehman Brothers collapsed, and is on course for its biggest December gains since 1991 when it rose 11.2 percent.

Retailers rose, with BJ's Wholesale Club Inc jumping 6.5 percent to $47.36 after the New York Post reported buyout firm Leonard Green & Partners remained interested in buying the warehouse club operator and may launch a hostile bid.

The Morgan Stanley Retail index <.MVR> climbed 0.8 percent, and the S&P Retail index <.RLX> gained 0.4 percent.

Sears Holdings Corp rose 6.1 percent to $74.30 after it said it launched an on-demand video service to compete with companies like Netflix Inc . Netflix fell 1 percent to $181.84 but are up 230 percent this year.

Molycorp Inc , which owns a rare-earth mine in Mountain Pass, California, was up 6.5 percent to $49.18 after China cut export quotas on the minerals, threatening to reduce already-tight global supplies and risking U.S. action.

Private equity company Blackstone Group LP made a preliminary offer for Centro Properties Group's 600 U.S. shopping center properties, the Wall Street Journal reported. Blackstone added 1.6 percent to $14.36.

Noble Energy Inc and its Israeli exploration partners confirmed earlier estimates that the offshore Leviathan prospect was Israel's largest natural gas find. Noble shares rose 2.8 percent to $87.35.

(Reporting by Edward Krudy; editing by Jeffrey Benkoe)