Several lending companies have gone under. So what happens to those loans? According to MSNBC, mortgages (the contract between the lender and the payer) are the only assets a lender has. They have a few options if they become unviable: they can seek more capital to stay afloat, it can sell to another lender, or it can declair bankruptcy which gives it several other options.
Mortgages are like other types of bond. Once the loan is originated, it has a face value and can be sold for more or less than that face value. If a company has to sell the loan they will make money or lose it depending on the market at the time of sale.
What does that mean for the homeowner? Well, the terms are typically left unchanged regardless of who holds the paper. Payments must be made no matter what the market looks like. The loan will likely always be held by some company even if they acquired it at pennies on the dollar. Probably the only change you would see is the destination for payments.