In short, YES. Filing a bankruptcy, whether it be Chapter 7 or Chapter 13, will stop the foreclosure process. However, filing a Chapter 7 bankruptcy may not stop the process permanently. When a Chapter 7 bankruptcy is filed, an "automatic stay" goes into effect. This "stay" stops, or at least temporarily prevents collection actions against a borrower by lenders. By filing a Chapter 7 bankruptcy, a mortgage lender pursuing foreclosure will have to cease such action because of the automatic stay. The filing of a Chapter 7 before foreclosure could be a valuable and worthwhile option because it will stop the foreclosure and discharge the debt associated with the property. After a Chapter 7 bankruptcy is filed, a borrower may be able to remain at their residence for an additional four to six months (or more) after the bankruptcy is filed. During this time, the borrower is not required to make ongoing mortgage payments, and that may allow a borrower to save some much needed money come moving time.
In some cases the mortgage lender may ask the bankruptcy court to remove the automatic stay so that they can proceed with the foreclosure. This action by a lender is not an overnight process, and does nothing to change the four to six month timetable mentioned previously.
Finally, filing a Chapter 7 bankruptcy may not only stop a pending foreclosure, but might also allow a borrower who has previously been denied a loan modification, to be approved as a result of the bankruptcy filing. Many factors are considered by lenders when determining whether or not to approve a loan modification. Among the factors considered are a borrower's outstanding debt and their income-to-debt ratio. So, by filing a Chapter 7 bankruptcy and discharging outstanding debts (like credit cards, personal loans, etc.), a borrower seeking a mortgage loan modification becomes a better candidate.
If you are facing foreclosure and have questions or concerns about it, you should consult with an experienced bankruptcy lawyer before it's too late.