NEW YORK - Stocks ended a volatile session mixed yesterday as investors wrestled with a troubling outlook for bond insurers, a $9.4 billion write-down at Morgan Stanley, and concerns that the economy is headed for recession.

Not all of yesterday's news was bad. Morgan Stanley managed to get a $5 billion investment from an arm of the Chinese government, and the Federal Reserve said its Monday auction of $20 billion in 28-day credit was met with solid demand - signs that there is cash out there to help the struggling banking industry recover.

But with just seven trading days left in 2007 and little data to convince Wall Street that the economy is on the upswing, investors hesitated to make big bets on stocks.

Standard & Poor's lowered its outlook for bond insurers, suggesting that the ratings on the bonds the companies insure may be headed lower.

S&P slashed the credit rating of ACA Financial Guaranty Corp. and put Financial Guaranty Insurance Co., another bond insurer, on watch for a downgrade. The agency maintained the ratings on Ambac Financial Group Inc., MBIA Insurance Corp., and XL Capital Assurance Inc., but it gave the bond insurers negative outlooks - meaning there is a one-third chance of a ratings cut for those companies in the next two years.

The Dow Jones industrial average fell 25.20, or 0.19 percent, to 13,207.27. The Standard & Poor's 500 index fell 1.98, or 0.14 percent, to 1,453.00, but the Nasdaq composite index added 4.98, or 0.19 percent, to 2,601.01.

Morgan Stanley rose $2.01, or 4.18 percent, to $50.08 after announcing the $5 billion China investment. The deal represents China's largest minority-stake purchase in a U.S. company, Thomson Financial analyst Richard J. Peterson said. The U.S. markets, though still distressed, are increasingly finding buyers in governments overseas.

Earnings reports were, for the most part, disappointing.

General Mills Inc. said profit in the most recent quarter edged higher, but results for the maker of cereal and packaged food were damped by soaring ingredient costs and other expenses. General Mills fell $1.08 to $57.99.

Palm Inc., the maker of the Treo and Centro smart phones, said late Tuesday that it swung to a loss in the most recent quarter. Its shares dropped 41 cents, or 6.91 percent, to $5.52.

Hovnanian Enterprises Inc. also posted a quarterly loss late Tuesday after facing a difficult housing market in the fourth quarter. The home builder's shares fell 96 cents, or 11.43 percent, to $7.44.