Stocks Eke Out Gains; Nasdaq Logs 4-Day Rally

Stocks squeezed out small gains Wednesday following the Fed's Beige Book report, but trading was thin and muted throughout most of the session as investors remained cautious ahead of Chairman Bernanke's speech at the end of the week.

The Dow Jones Industrial Average rose 4.49 points, or 0.03 percent, to close at 13,107.48, led by Verizon , after logging losses in the last two sessions.

The S&P 500 added 1.19 points, or 0.08 percent, to end at 1,410.49. The Nasdaq gained 4.05 points, or 0.13 percent, to finish at 3,081.19. The Nasdaq rose for the fourth-straight session. Yet, the index is up only 0.91 percent over the last four days, marking the weakest four-day winning streak since October 2010.

The CBOE Volatility Index, widely considered the best gauge of fear in the market, traded above 16.

Telecoms led the key S&P sector gainers, while energy held losses.

The economy continued to show improvementin July and early August, but manufacturing activity weakened in many areas of the country, according to the Fed's latest Beige Book, a region-by-region report on business activity collected from cities nationwide.

The Fed also said retail activity, including auto sales, had picked up since its previous report.

The report comes ahead of the central bank's widely-anticipated annual symposium in Jackson Hole, Wyoming, where investors will listen closely to Chairman Bernanke for any hints of further easing. (Read More: What Markets Really Think Bernanke Will Say on Friday)

(Confronting the Crisis: Tune in all day Thursday and Friday to CNBC for coverage on the Fed at Jackson Hole.)

“All is quiet on the European front, in a historically quiet week with quiet economic metrics, and everyone’s waiting for Jackson Hole,” said Sal Arnuk, co-manager of trading at Themis Trading. “We are left with a lifeless market.”

The U.S. economy fared slightly better than expectedin the second quarter, expanding at a 1.7-percent annual rate, according to the Commerce Department. (Read More: Party Over? Economist Sees No-Growth Decade Looming)

Yelp surged more than 20 percent even as the lockup on nearly 53 million of its shares expired.

Apple's request for an injunction against certain Samsung products will be heard by a judge on December 6. The request follows the iPhone maker's victory in the patent case versus its rival last week. Meanwhile, Samsung unveiled the second generation of its Galaxy Note at Europe's biggest electronics show in Berlin.

Rival Nokia , which has a close partnership with Microsoft , is scheduled to release its new Lumina smartphone in New York next week.

Among earnings, Joy Global shares reversed their losses to end higher even after the mining equipment maker slashed its outlook for 2012 on slowing demand in China.

H.J. Heinz posted better-than-expected earnings, a day after the ketchup producer said profit would top estimates, sending shares to their highest in more than 13 years.

Pandora and TiVo are slated to post earnings after the closing bell.

Also on the economic front, pending home sales in July jumped to their highest level in more than two years, according to the National Association of Realtors.

Weekly mortgage applications declined last weekas refinancing demand fell for the fourth-straight week, according to the Mortgage Bankers Association.

Treasury prices held their lossesafter the government auctioned $35 billion in 5-year notes at a high yield of 0.708 percent and a bid-to-cover of 2.92.

Isaac weakened to a tropical storm as it continues to move farther inland, according to the U.S. National Hurricane Center. Oil prices settled loweron expectations that damage from the storm will be limited and following a report showing a sharp gain in crude oil supply.

By CNBC’s JeeYeon Park (Follow JeeYeon on Twitter: @JeeYeonParkCNBC)

Coming Up This Week:

THURSDAY: Jobless claims, personal income & spending, 7-yr note auction, chain-store sales; Earnings from Zumiez
FRIDAY: Chicago PMI, consumer sentiment, factory orders, farm prices, Bernanke's Jackson Hole speech

More From CNBC.com: