Chapter 13 bankruptcy may be a good option if you're trying to save your home from foreclosure. Chapter 13 bankruptcy lets you pay off a mortgage "arrearage" (late, unpaid payments) over the length of your repayment plan -- usually between three and five years. In order for this to work, you'll need enough income to meet your current mortgage payment at the same time you're paying off the arrearage.
Once you file your Chapter 13 bankruptcy petition, the "automatic stay" stops foreclosure proceedings until your repayment plan is approved (or rejected) by the court. If approved, the mortgage lender is then bound by the plan and must accept payments towards the arrearage over the length of your repayment period. If you make all the required payments up to the end of the repayment plan (and keep current on your regular monthly mortgage payments), you'll avoid foreclosure and keep your home. To learn more about how Chapter 13 bankruptcy can help homeowners, see Nolo's article Your Home in Chapter 13 Bankruptcy.