It is possible to assume a loan, though it is rarer than it used to be. If you assume the loan by paying the remaining balance, you own the property and it does not go through foreclosure. A real estate agent should be able to help you with the process and if you do it, it can be a great, creative way to make a cheap purchase.
Typically, it doesn't work because the owner who is near being foreclosed lacks equity in the house and is underwater.
You may have more luck with a short sale, where you negotiate for the property once it is foreclosed, directly with the bank, at a cheaper-than-retail cost. Best of luck, and I hope you can assume that loan!