Hopes the euro zone will figure out a solution to its ongoing debt crisis inspired enough buying to push stocks to a third day of gains on Wednesday in light trading.

Euro zone nations are expected to vote on Friday on an agreement hashed out between Germany and France to tighten fiscal controls for member nation.

Equities and other markets have hinged on euro zone sovereign debt crisis headlines for weeks, with markets expected to become increasingly volatile as more details leak as the summit draws closer. Traders are looking to position themselves ahead of an escalation of the crisis or a clear, manageable plan to keep it under control.

We are in a holding mode waiting to see if they can actually herd the kittens in the EU to come to something, said Ben Willis, director of floor operations for Sunrise Securities in New York. All we are looking for is progress, we are not looking for anything perfect, we are not looking for the ultimate solution.

Financials were among the best performers, with JPMorgan Chase & Co up 2.3 percent to $34. The S&P financial sector index <.GSPF> rose 1.2 percent.

Volume was light with about 7 billion shares traded on the New York Stock Exchange, NYSE Amex and Nasdaq, below the daily average of 7.95 billion.

The market remained jumpy given the track record of previous EU summits that disappointed investors. Comments on Wednesday from an unnamed German official that Berlin was increasingly pessimistic about a deal hit stocks early in the day.

Bearish developments, including Standard & Poor's euro zone credit rating downgrade warning on Monday, failed to trigger selling.

Despite the optimistic start to the week, the benchmark S&P 500 was unable to hold above its 200-day moving average for the third consecutive session, seen as a key technical resistance point which could trigger more buying.

The Dow Jones industrial average <.DJI> gained 46.24 points, or 0.38 percent, to 12,196.37. The Standard & Poor's 500 Index <.SPX><.INX> added 2.55 points, or 0.20 percent, to 1,261.02. The Nasdaq Composite Index <.IXIC> shed 0.35 points, or 0.01 percent, to 2,649.21.

French officials said French and German leaders will not leave the weekend summit until a powerful deal was reached. They want to impose mandatory penalties on nations that exceed deficit targets, a plan backed by U.S. Treasury Secretary Timothy Geithner, who is on a trip to Europe.

Among individual stocks, Martha Stewart Living Omnimedia Inc jumped 28.8 percent to $4.02 after JC Penney Co agreed to buy a 16.6 percent stake.

Men's Wearhouse Inc's shares surged 19.6 percent to $32.51 a day after the clothing retailer reported quarterly profit that topped expectations.

Advancing stocks outnumbered decliners on the New York Stock Exchange by a ratio of about 1,567 to 1,403, while on the Nasdaq, decliners outpaced advancers 1,326 to 1,149.

(Reporting By Chuck Mikolajczak; Editing by Andrew Hay)