Stocks rallied for a second day on Wednesday as investors bet the Federal Reserve's aggressive rate cut would help prevent an economic slowdown.

Housing-related stocks such as home builders and mortgage finance companies were among the biggest percentage gainers in the S&P 500, a day after the Fed cut the benchmark interest rates by a half-percentage point.

Shares of major banks, which usually benefit from a drop in short-term rates, also rose, along with manufacturers, including Caterpillar Inc., up 1.6 percent at $78.67.

Also, shares of Fannie Mae and Freddie Mac advanced after the regulator for the two mortgage finance companies said they can buy more subprime mortgages under rules unveiled on Wednesday.

But investment bank Morgan Stanley's earnings missed analysts' estimates and its shares fell 2.4 percent to $66.86.

The Dow Jones industrial average was up 94.78 points, or 0.69 percent, at 13,834.17. The Standard & Poor's 500 Index was up 12.37 points, or 0.81 percent, at 1,532.15. The Nasdaq Composite Index was up 21.50 points, or 0.81 percent, at 2,673.16.

Morgan Stanley was the second major investment bank this week to report earnings, coming on the heels of Lehman Brothers Holdings Inc, which reported earnings that beat Wall Street's estimates on Tuesday.

The Dow Jones home builder index rose 3.1 percent and the KBW Mortgage Finance index added 2.4 percent. Fannie Mae's shares were up 3 percent at $64.39 and Freddie Mac's stock gained 3.8 percent to $61.79.

(Additional reporting by Kristina Cooke)