If you sell short - means the sale for less than the debt outstanding that is secured by the property - reportable on 1099-S - http://www.irs.gov/pub/irs-pdf/f1099s.pdf - should be treated as disposition of the property at the sale price.
The foreclosure itself - reportable on 1099-A - http://www.irs.gov/pub/irs-pdf/f1099a.pdf should be treated as disposition of the property at fair market value.
If the creditor sells the property after foreclosure - the person may receive both these forms.
If the creditor decides that the debt may not be collected - all or part of the debt may be forgiven. The amount of debt forgiven reportable on 1099-C - http://www.irs.gov/pub/irs-pdf/f1099c.pdf - generally is taxable, unless an insolvency exemption apply -- you should file a form 982 - to proof your insolvency - and might exclude all or part of canceled debt from taxable income.
This is true even if you did not file for bankruptcy.
Please see the IRS Publication 908 Bankruptcy Tax Guide - http://www.irs.gov/pub/irs-pdf/p908.pdf - with example of the form 982 on the last page.
The Mortgage Forgiveness Debt Relief Act of 2007 signed at the end of the last year provides additional relief - http://www.govtrack.us/congress/bill.xpd?bill=h110-3648 that allows exclusion of income realized as a result of modification of the terms of the mortgage, or foreclosure on your principal residence.
The Act applies to qualified debt forgiven in 2007, 2008 or 2009 - and only to forgiven or canceled debt used to buy, build or substantially improve your principal residence, or to refinance debt incurred for those purposes.
The amount of debt forgiven still must be reported on Form 982 and the Form 982 must be attached to your tax return.
Please be advised that you have only 6 month after tax return is due to file 982 form.