Updated from 4:09 p.m. EDT

Stocks had a tremendous session Wednesday after Federal Reserve Chairman Ben Bernanke said he sees signs that both economic growth and inflation are moderating. The comments prevented Yahoo!'s ( YHOO) pummeling from causing wider damage.

The Dow Jones Industrial Average advanced 212.19 points, or 1.96%, to 11,011.42, and the S&P 500 added 22.95 points, or 1.86%, to 1259.81. The Nasdaq Composite was higher by 37.49 points, or 1.83%, to 2080.71, aided by a 2.3% gain on the Philadelphia Semiconductor Sector Index.

For the Dow, the session was one of its strongest point gains for 2006. Wal-Mart ( WMT) rose 2.4% after a federal judge overturned a Maryland law that would have required the retailer to spend more on employee health care.

Overall, 29 of the Dow's 30 components finished the session with gains. Altria ( MO) was the only loser.

"It's hard to say if this is a one-day wonder that triggered today," said Paul Mendelsohn, chief investment officer with Windham Financial. "We reached such an oversold position that we got a nice technical bounce thanks to Bernanke's testimony. However, a lot of the problems that have taken us down haven't gone away. There's conflict in the Middle East and various sectors giving us problems."

About 1.87 billion shares changed hands on the New York Stock Exchange, with advancers outpacing decliners by a 7-to-1 ratio. Volume on the Nasdaq was 2.35 billion shares, and four stocks rose for every one that fell.

Bernanke ignited the averages in an address before Congress, saying "a sustainable, noninflationary expansion is likely to involve a modest reduction in the growth of economic activity from the rapid pace of the past three years to a pace more consistent with the rate of increase in the nation's underlying productive capacity."

Barring an unforeseen disaster, said Bernanke, "the economy should continue to expand at a solid and sustainable pace and core inflation should decline from its recent level over the medium term."

The text of Bernanke's prepared comments, with language that was nearly identical to the Federal Open Market Committee's recent policy statement, was released just before his testimony got under way a little after 10 a.m. EDT.

To view Gregg Greenberg's video take on today's market, click here

Bernanke added that "the pickup in inflation so far this year has also been reflected in the prices of a range of nonenergy goods and services, as strengthening demand may have given firms more ability to pass energy and other costs through to consumers. As I noted earlier, FOMC participants project that the growth in economic activity should moderate to a pace close to that of the growth of potential both this year and next."

"This is a pretty clear signal that Mr. Bernanke does not think the recent inflation numbers ought to have much impact on the debate over whether to hike again," said Ian Shepherdson, chief economist with High Frequency Economics. "The key question is whether the tightening already in place is enough to slow the economy to a pace that will, over time, reduce inflation pressure."

Meanwhile, shares of Yahoo! slumped 21.7% after the Internet company posted a second-quarter profit of $164 million, or 11 cents a share, on sales of $1.12 billion. While net income matched Wall Street forecasts, sales were about $20 million light. For the third quarter, Yahoo! sees sales of $1.12 billion to $1.23 billion. Analysts were looking for $1.20 billion. Yahoo! dropped $6.99 to finish at $25.25, a 52-week low.

IBM ( IBM) ended 2.4% higher after saying second-quarter earnings rose 14% to $2.02 billion, or $1.30 a share, beating estimates by a penny. At $21.89 billion, sales were down 2% from a year ago but matched the Thomson First Call consensus. IBM tacked on $1.81 to $76.07.

Traders also had to factor in the Labor Department's consumer price index, which increased 0.2% in June. However, the core CPI rose a greater-than-expected 0.3%. The core number is now up 2.6% year over year. The report comes a day after a slightly higher-than-expected reading on the producer price index.

"The CPI has moved up higher than where the Fed is comfortable," said Barry Hyman, equity market strategist with EKN Financial. "It's going to be hard for the Fed to withhold raising rates again. It puts into perspective again rising inflation against a slowing economy. We will need conciliatory talk about inflation being contained if we hope to keep the market going higher."

Odds of the fed funds rate reaching 5.50% at the Aug. 8 Fed meeting sank to 74% after Bernanke's speech, down from 90% following the CPI report. The 10-year Treasury bond reversed an early decline and ended up 19/32 in price to yield 5.05%. The dollar fell against the yen and euro after Bernanke's testimony.

Also on the economic docket, the Commerce Department said housing starts fell 5.3% in June to 1.85 million units on an annualized basis, below expectations. Building permits dropped to 1.86 million, also below the consensus.

Oil extended its recent slide even as Israeli and Hezbollah forces continued to exchange missile fire along the Lebanese border. Nearly 270 people are reported dead in eight days of Mideast violence, according to wire reports. August crude was down another 88 cents to $72.66 a barrel, the third straight decline and its lowest level in three weeks.

Crude's decline came after the Energy Department said crude inventories rose by 200,000 barrels last week, while gasoline stocks unexpectedly rose by 1.5 million barrels. After the data's release, the Philadelphia Oil Service Sector Index rose 2.1%, and the Amex Oil Index was higher by 0.7%.

JPMorgan Chase ( JPM) posted a second-quarter profit of $3.54 billion, or 99 cents a share, up from $994 million, or 28 cents a share, last year. Results, which included gains from the sale of MasterCard ( MA), beat the Thomson First Call consensus of 87 cents a share. Revenue increased to $15.72 billion from $13.71 billion a year earlier. The stock climbed $2.34, or 5.8%, to $43.05.

Meanwhile, Bank of America ( BAC) reported second-quarter earnings of $5.5 billion, or $1.19 a share, up 18% from a year ago. Analysts expected earnings of $1.10 a share, according to Thomson First Call. Bank of America added $1.51, or 3.1%, to $49.95.

UnitedHealth Group ( UNH) posted second-quarter earnings of $974 million, or 70 cents a share, rising from $770 million, or 58 cents, a year ago. Revenue jumped to $17.92 billion from $11.39 billion a year ago. The Thomson First Call consensus was for EPS of 68 cents on revenue of $17.96 billion. Shares closed higher by $2.53, or 5.2%, to $50.93.

After the closing bell, Intel ( INTC) posted a second-quarter profit of $885 million, or 15 cents a share, down from $2 billion, or 33 cents a share, a year earlier. Results beat the Thomson First Call consensus by 2 cents. However, sales slid 10% to $8 billion, coming in below estimates. Intel finished the session up 28 cents, or 1.5%, to $18.49, but was down 2% in the after-hours session.

Also after the close, earnings reports are coming in from Apple Computer ( AAPL), eBay ( EBAY), Qualcomm ( QCOM) and Motorola ( MOT).

Overseas markets were higher, with London's FTSE 100 adding 1.7% to 5778 and Germany's Xetra DAX up 2.6% to 5539. In Asia, Japan's Nikkei rose 0.4% overnight to 14,500, and Hong Kong's Hang Seng gained 0.3% to 16,098.