The Dow Jones industrial average (^DJI) rose 18.67 points, or 0.12 percent, to 15,470.52, while the Standard & Poor's 500 (^GPSC) index climbed 4.65 points, or 0.27 percent, to 1,680.91. The Nasdaq composite (^IXIC) gained 11.50 points, or 0.32 percent, to 3,610.00.
In testimony before the House Financial Services Committee, Bernanke told lawmakers the Fed's timetable for reducing its bond purchases isn't on a "preset course," and that the central bank could increase or decrease the amount based on how the economy performs.
Bernanke noted that the labor market had made some progress since the Fed began buying $85 billion a month in bonds in September, and repeated his belief that the Fed could slow that pace later this year if the economy strengthens.
In other economic news, the Commerce Department reported that housing starts fell to a 10-month low in June, mostly because apartment construction fell sharply. But applications for permits to build single-family houses rose to the highest level in five years, suggesting the housing recovery will continue.
The Federal Reserve said the U.S. economy grew in most parts of the country, from late May through early July. In its latest survey, known as the Beige Book, the Fed said economic activity was bolstered by the housing recovery, consumer spending and increased factory output.
In commodities trading, the price of crude oil rose 48 cents to $106.48 a barrel. Gold fell $12.90, or 1 percent, to $1,277.50 an ounce.
Billionaire activist Carl Icahn renewed his call for Dell (DELL) shareholders to vote against a buyout offer from company founder Michael Dell. Stockholders are scheduled to vote Thursday on Dell's plan to take the No. 3 PC maker private in a $24.4 billion deal. Icahn argues that Michael Dell's $13.65-a-share offer "substantially" undervalues the company. Dell reportedly won't raise his offer, even if the shareholder vote is delayed, a move aimed at boosting support for the deal.
Google (GOOG) appears poised to introduce the next generation of its Nexus tablets -- at least, that's what invitations sent Wednesday to the media suggest. The unveiling is likely to come at a July 24 event in San Francisco.
Among other stocks in the news:
- Yahoo (YHOO) rose $2.78, or 10.3 percent, to $29.66 after reassuring investors that it would keep buying back its own stock. The Internet company has already spent $3.6 billion buying back about 190 million of its shares since last year.
- Shares of Bank of America (BAC) jumped 38 cents, or 2.7 percent, to $14.30 after the company reported a 70 percent increase in profits, driven largely by cost-cutting. The Charlotte, N.C.-based company earned $3.6 billion in the quarter, or 32 cents a share, beating analyst expectations.
- St. Jude Medical (STJ) jumped $2.52, or 5.2 percent, to $50.98 after the medical device maker reported better-than-expected second-quarter earnings on higher sales of its heart-shocking implants.
- American Express (AXP) fell $1.50, or 1.9 percent, to $76.77 after a report said European regulators are proposing to cap the lucrative processing fees the card company imposes.
- Mattel (MAT) fell $3.17, or 6.8 percent, to $43.16 after its second-quarter net income fell 24 percent, hurt by weak sales in North America and continued softness in Barbie demand, as well as an asset impairment charge.
- Knoll Inc. (KNL) reported a drop in its second-quarter revenue and net income, but the results beat market expectations. Shares rose temporarily but ended the day unchanged, at $15.50.
- A day after reporting a 4.5 percent rise in profits, CSX Corp. (CSX) officials said investors shouldn't expect much earnings growth this year. The company did predict earnings would grow 10 to 15 percent in 2014 and 2015, as the economy recovers and shipments of crude oil and the sand used in shale oil mining keep growing. CSX stock advanced 43 cents, or 1.8 percent, to settle at $25.07.
- The Labor Department releases weekly jobless claims at 8:30 a.m. Eastern time.
- At 10 a.m., Freddie Mac releases weekly mortgage rates, and the Conference Board releases leading indicators for June.
- Capital One Financial Corp. (COF)
- Google Inc. (GOOG)
- Microsoft Corp. (MSFT)
- Nokia Corp. (NOK)
- Philip Morris International Inc. (PM)
- Safeway Inc. (SWY)
- Union Pacific Corp. (UNP)
- UnitedHealth Group Inc. (UNH)
- Verizon Communications Inc. (VZ)
-Compiled from staff and wire reports.