If you own rental property, the effects of filing for bankruptcy depend on how much equity you have in the property, your state's law, and whether you file under Chapter 7 or Chapter 13.
Rental Property in Chapter 7
If you use Chapter 7, the trustee can take any property you own that isn't exempt under your state law (or under federal law, if your state allows debtors to choose between the state and federal exemption lists). Generally, real estate other than your residence isn't protected by state exemptions.
If your equity is relatively low, you may be able to protect the property using a wildcard exemption. If you are underwater on your rental property mortgage, the trustee likely won't bother to take it: After paying off the mortgage holder, there would be nothing left to distribute to your other creditors.
Rental Property in Chapter 13
If you use Chapter 13, the trustee doesn't take your nonexempt property. However, if you have a lot of equity in your rental property, it will increase the amount you have to pay into your repayment plan. Your unsecured creditors are entitled to receive at least the value of your nonexempt property, so your payments will be higher if your rental property is valuable.
In addition to getting to keep your property, there are other benefits to using Chapter 13. For example, if you have missed some mortgage payments on your rental property, you can make up the arrearage over time in your repayment plan. And, you may be able to cram down your mortgage on rental property to the current value of the property, if you owe more than it's worth.