Your lease requires that you make payments of rent in exchange for the right to live in the property. The fact that the house is in foreclosure does not change your obligation. Why would you think that you would be able to stay in the house without paying rent?
Disclaimer: This answer is provided for informational purposes only, does not constitute legal advice, and does not create an attorney-client relationship. Actual legal advice can only be provided after completing a comprehensive consultation in which all of the relevant facts are discussed and reviewed.
To further the answer given by Mr. Deason, you need to realize that an owner of property during a foreclosure action always has the right to redeem with the bank. This means the owner can payoff the mortgage. In other situations, the owner might be able to simply reinstate the mortgage by bringing all amounts current. Therefore, even in a foreclosure action, you still must pay rent to the landlord for your right to remain in possession of the property. I have also seen language in certain lending documents that require that rental payments start going to the bank during the foreclosure action. You would not know this unless the bank contacted you and provided a copy of the document giving them the right to have you pay the bank directly instead of your landlord.
You should file your written lease--if you have one--with the clerk of courts as proof that you are a current resident of the premises. I advise you to pay the current owner the rent money up to the date of the foreclosure sale and then after you have received proper notice that there is a new owner, pay the money to the new owner.
Sometimes sales fall through and are canceled even on the day of the scheduled sale.
Banks sometimes lie and say that they are the new owner, even when the foreclosure sale is still a month or more away. Be sure to look up the records at the clerk of courts' website for verification.