I don't believe you provided enough information here. The big question is whether you are the owner or a tenant.
If you are the owner, then it is unlikely the bank would re-sell the house to you at the foreclosed price. If that were the case, then everyone would be doing it and banks would be closing left and right. However, again, if you are the owner, you can approach your bank and request a loan modification. This can either lower your rate (permanently or temporarily), reduce the amount you owe or allow you to defer payments for a time to help you get back on your feet. Banks don't like to foreclose, they would rather work with the owners to help them stay in the homes.
If you are a tenant and you are a disinterested party (no family, friend or business relation to the owner), then you can approach the owner, find out what he owes and offer to purchase the home for that amount. There would be closing costs involved and you would have to decide who pays them, but this is the cleanest and easiest way. The other way is to keep an eye out for signs that the bank is taking back the house. In fact, you might be among the first to know since if you're a tenant, the bank has to notify you of foreclosure proceedings. Then, approach the bank and see what you can work out for a fair price, or, wait until it gets put on the market and contact the listing agent immediately.