Check your mortgage documents, there should be a section that deals with Recourse. it should give you an idea of what the lender can pursue in your state. If you have been foreclosed on or are in the process check the documents to see if the lender is entitled to a deficiency judgment or are they willing to waive it. if the foreclosure hasn't taken place yet negotiate with them.
I am not an attorney or an accountant. MOST IMPORTANT get legal and tax advise from the appropriate professionals.