Traders were also encouraged by a downward revision in second-quarter economic growth Friday that wasn't as bad as economists had expected. The Dow Jones industrial average and other indexes all gained more than 1 percent.
Bernanke said in a speech at the Fed's annual conference that while the recovery remains tentative, the central bank remains ready to take extra steps to stimulate the economy if necessary. He said he still expects growth next year.
"It could have been worse, and because it wasn't, that was good news," said Alan Gayle, senior investment strategist for RidgeWorth Investments, based in Richmond, Va.
The upturn was a respite from a mainly dismal month on the stock market, which has been falling steadily since its recent high, reached on Aug. 9 on a series of poor indicators on the economy. A deep slump in home sales last month was the latest sign that the economy was weakening.
The Dow Jones industrial average rose 164.84 points, or 1.7 percent, to close at 10,150.65. The Standard & Poor's 500 Index rose 17.37, or 1.7 percent, to 1,064.59 and the Nasdaq composite index rose 34.94, or 1.6 percent, to 2,153.63. The Dow was down 0.6 percent for the week, the S&P 500 was down 0.7 percent, and the Nasdaq lost 1.2 percent.