I got a lot of questions last night at our Foreclosure and the Economy continuing education class about this topic, so I figure its one on everyone's mind.
Under the The Mortgage Debt Relief Act of 2007 a taxpayer can generally exclude from gross income monies that are forgiven under a short sale or deed in lieu situation. This is a great situation because the bank's agreement to not go after deficiencies should not result in the government making the borrower pay a huge tax. The purpose is to help someone without money, not to harm them. Yet, there are exceptions for qualified principal residence indebtedness, which is not related to the home's purchase or improvements (i.e. cashing our to pay other bills). Moreover, there are other means for a taxpayer to avoid paying income tax on other cancelled debt whether it be from credit cards or business properties. For 2 great articles on the topic, I direct your attention to this link, which is a great summary of the topic and this link, which is Publication 4681 from the IRS as the last word on the topic (from the government's perspective).
Remember, an insolvent debtor can always avoid paying income tax on cancelled debt.