Stocks stuck in a summer rut

Stocks ended with slim gains Wednesday, as many investors remain sidelined or on vacation.

Markets were mired in a narrow range for most of the day, following early reports on U.S. economic growth and pending home sales.

The government reported that the U.S. economy grew at a slightly faster pace in the second quarter, and a separate report from the National Association of Realtors showed pending home sales at their highest level in two years. However, the GDP revision, while better than expected at 1.7%, was still weak.

"Clearly we had a mixed bag on the economic front," said Ryan Detrick, a strategist at Schaeffer's Investment Research. "But all in all, the home data has been a beacon of light."

Though Detrick says the data may indicate some positive news, many investors aren't willing to make any big bets at least until Friday, when Federal Reserve Chairman Ben Bernanke speaks in Jackson Hole, Wyo. Many remain hopeful that he will give hints about new stimulus measures to give the U.S. economy a boost.

Worries about Europe continue to keep investors on edge. Spain's recession is deepening, yet borrowing costs continued to ease. Along with Greece, Spain has become a thorn in investors' sides recently. Given its sluggish economy, high unemployment and troubled banking sector, many think the nation will be forced to seek a bailout soon.

Meanwhile, oil prices hovered near $95 a barrel, as Hurricane Isaac curtailed oil production along the Gulf of Mexico. But gas prices jumped 4.8 cents to $3.804 Wednesday, according to motorist group AAA. Gas prices are now up nearly 9% in August and at their highest level since early May.

Economy:The August edition of the Federal Reserve's Beige Book report, a regional snapshot of economic conditions suggested that economic activity has grown across most regions and sectors, including retail.

Jos A. Bank Clothiers Inc(JOSB) reported better-than-expected earnings and shares rose 14% after the clothing company announced it would also expand the chain to 800 stores nationwide.

Sealed Air Corp(SEE) was one of the biggest gainers on the S&P 500. Shares of the company jumped more than 12% after Sealed Air announced a new CEO and succession plan.

WellPoint(WLP) shares climbed about 8% after the health insurer announced its CEO would resign.

Pandora(P) and TiVo(TIVO) will release their earnings after the bell. Pandora is expected to report a loss of 3 cents a share on $101 million in revenue, while TiVo is expected to post a loss of 24 cents a share on $54 million in revenue.

Currenciesandcommodities: The dollar gained against the euro and Japanese yen, but lost ground versus the British pound.

Gold futures for December delivery fell $6.70 to $1,663.00 an ounce.

Bonds: The price on the benchmark 10-year U.S. Treasury rose, pushing the yield up to 1.66% from 1.63% late Tuesday.