NEW YORK (CNNMoney.com) -- Stocks ended lower Wednesday, erasing earlier gains, as the Federal Reserve's dour economic outlook curbed optimism about the health of U.S. banks.

The Dow Jones industrial average (INDU) fell about 50 points, or 0.6%, after gaining more than 100 points early in the session. The S&P 500 (SPX) index fell 0.5% while the Nasdaq composite (COMP) lost 0.4%.

Stocks surged in early trading after Bank of America's $13.5 billion stock sale raised bets that the financial sector is stabilizing. Energy stocks also rallied as oil prices rose to a 6-month high.

But the market slumped in the final hour of trading after the Federal Reserve reduced its growth targets and raised unemployment expectations. The central bank also said it expects a recovery in sales and production to begin during the second half of the year.

Todd Clark, director of stock trading at Nollenberger Capital Partners, said some investors took the Fed report as a cue to cash in the day's gains.

"I think people are saying: We've had a pretty decent run, maybe it's a good time to take some chips off the table," Clark said. He also noted that Wednesday's retreat came as the market neared the top of its recent trading range.

Still, the overall tone remains relatively bullish. The CBOE Volatility Index, or VIX, which is considered a gauge of investor fear, fell further after ending Tuesday at its lowest level since September.

"The fear factor is diminished," said Todd Morgan, senior managing director at Bel Air Investment Advisors. "The economy is still sick, but things are starting to look a little better."

Economic indicators on tap for Thursday include: a government report on weekly jobless claims, a regional manufacturing survey and an index of leading indicators.

Fed: According to the minutes from its last policy meeting, the Fed said it expects 2009 gross domestic product to shrink between 1.3% and 2%. That compares with January's projection for a decline between 0.5% and 1.3%.

The Fed's staff now expects the unemployment rate to rise to between 9.2% and 9.6%. In January, the jobless rate was forecast to rise to between 8.5% and 8.8%, but the unemployment rate topped that in April, hitting 8.9%.

But the Fed also pointed to signs the pace of the recession is easing.

"Participants (in the meeting) also saw recent indications that the economic downturn was slowing in the second quarter, and they continued to expect that sales and production would begin to recover - albeit gradually - during the second half of the year," the central bank said.

Banks: Treasury Secretary Tim Geithner told the Senate Banking Committee Wednesday that stress-tested banks have set out to raise $56 billion to plug holes in their books.

Geithner also said there are "encouraging signs the financial system is starting to heal." But he warned that "we're only beginning to lay the foundation for economic recovery."

After the close Tuesday, Bank of America (BAC, Fortune 500) said it has raised $13.47 billion through a sale of stocks. The bank has issued 1.25 billion shares since Friday at an average price of $10.77. BofA, whose shares rose more than 2%, needs to raise $33.9 billion to meet the government's stress test requirements.

"Banks being able to raise new capital is a good sign," said David Levy, a portfolio manager at Kenjol Capital Management. He said it signals a "regression towards normal."

Economy: Congress passed a bill Wednesday that imposes greater restrictions on the credit card industry for raising fees and interest rates. The approval came despite strong objections by banking industry advocates, who say it could result in tightened credit to Americans.

Separately, President Obama said the financial markets have improved recently, but he cautioned that unemployment will remain elevated for some time. The president's remarks came during a public meeting of his special economic advisory group, which is led by former Fed chief Paul Volcker.

Also Wednesday, the Senate's Special Committee on Aging heard testimony that the agency that guarantees the nation's corporate pensions, the Pension Benefit Guaranty Corp., posted a record $33.5 billion deficit in the first half of the current fiscal year.

Companies: Retailer Target (TGT, Fortune 500) reported that first-quarter profit fell to 69 cents per share, a 7% decline from 75 cents a year earlier. The results topped analyst expectations of 60 cents per share, according to a consensus from Thomson Reuters. Target shares rose more than 2%.

Late Tuesday, PC maker Hewlett-Packard (HPQ, Fortune 500) reported quarterly results that were in line with Wall Street's estimates. The company also said it would cut 6,400 jobs, or 2% of its workforce. HP shares fell 5%.

World markets: Most markets in Asia finished in positive territory. In Europe, major markets were mixed.

Japan's gross domestic product fell 4% last quarter -- the fastest pace on record for the country, the government said Wednesday. GDP in the world's second largest economy was 15.4% lower than the same time period last year, according to figures released by Japan's Cabinet Office.

Oil and money: Crude prices rose to a six-month high, settling up $1.94 to $62.04 a barrel, after the government said U.S. supplies of crude oil and gasoline fell more than expected last week. It was the first settlement above $60 for the active-month contract since Nov. 10; Wednesday was the first day that the July contract was the active month.

The dollar slipped versus major international currencies including the euro, the yen and the British pound.

COMEX gold for June delivery rose $10.70 to settle at $937.40 an ounce.