Your absolute best option is to offer a deed in lieu of foreclosure because it avoids foreclosure and a deficiency. It is a peaceful return of the property to the lender. The only catch is if the lender will accept it - which is totally up to it.
If the lender will not accept the deed in lieu, and you can't file bankruptcy before the foreclosure, you absolutely can include the deficiency in your bankruptcy when you file.
If you file bankruptcy BEFORE there is a deficiency judgment, the mortgage will simply be included in your bankruptcy and discharged accordingly - there will never be a deficiency judgment.
If you file bankruptcy, the lender will ask the court for permission to foreclose on the property - which the court will allow - and whatever the sale produces will be all of the recovery the lender will have. The remaining balance owed will simply be discharged.
DISCLAIMER: Answers from Experts on JustAnswer are not substitutes for the advice of an attorney. JustAnswer is a public forum and questions and responses are not private or confidential or protected by the attorney-client privilege. The Expert above is not your attorney, and the response above is not legal advice. You should not read this response to propose specific action or address specific circumstances, but only to give you a sense of general principles of law that might affect the situation you describe. Application of these general principles to particular circumstances must be done by a lawyer who has spoken with you in confidence, learned all relevant information, and explored various options. Before acting on these general principles, you should hire a lawyer licensed to practice law in the jurisdiction to which your question pertains.
The responses above are from individual Experts, not JustAnswer. The site and services are provided “as is”. To view the verified credential of an Expert, click on the “Verified” symbol in the Expert’s profile. This site is not for emergency questions which should be directed immediately by telephone or in-person to qualified professionals. Please carefully read the Terms of Service (last updated February 8, 2012).