I recently went on a trip and planned to stay overnight in Meron. I didn’t make sleeping arrangements because I knew that there are places where one can show up without a reservation and pay for a bed. However, when I arrived I found that all the beds were taken for the night. I found an empty spot and slept on the floor. In the morning the owner noticed me and demanded payment. I refused since I hadn’t rented from him. Am I liable?
Your case is discussed in the Gemara (Bava Kama 21A). The Gemara rules that if one lived in someone’s property without permission he is sometimes liable. The Gemara explains that if the property was on the market for rental then the one who occupied it has to pay rent even though he never formally rented it. But if the property was not on the market for rental then the one who occupied the property is often not liable.
The rationale of the Gemara is that if A derives benefit from B without causing a loss to B then A does not have to pay for the benefit he enjoyed. In the language of the Gemara we rule that zeh neheneh vezeh lo chosair is not liable. Therefore, if the property was not on the market for rental the owner did not suffer a loss of rental income and the occupant is not liable.
At first glance, it seems that in your situation, since the owner was renting places, you might be liable. However, yours is not the simple case since all the beds were already occupied and the owner was not renting places to sleep on the floor. Therefore, you did not deprive him of any rental income. This is similar to a ruling of the Ramo (363, 10) in case the owner of a house which was usually rented out, left town without leaving a manager to rent out his property. He rules that if someone else, who was not the owner, rented out that property, the tenant does not owe anyone for the rental. He does not owe the owner since the owner was not able to rent out the property. Since the owner suffered no loss the renter owes him nothing. He does not owe the one who rented it to him since the one who rented it to him was not the owner.
However, there is one critical condition. The Gemara states that even if the owner didn’t lose any rental income, if he lost money in a different manner the renter is liable. The example of the Gemara is where the occupant sullied the walls from the soot of the fire which he used to heat the house. A number of Acharonim including the Ketsos (363, 4) add that even if the damage is so minuscule or, because of technical reasons in terms of the rules of damages, the occupant would not be liable, nevertheless, since the occupant derived benefit he is liable.
The Rishonim dispute the extent of the tennant’s liability. Tosafos (21A s.v. veyahavi) and the Rosh (2, 6) and many others rule that since the owner suffered a loss, the occupant needs to pay for his entire benefit and not just the amount of the owner’s loss. The Ramah (cited by the Nemukei Yosef 9A) disagrees and rules that the occupant is only liable for the owner’s loss. Only if due to a technical reason (e.g. grommo) he did not need to pay, then, since he derived benefit, he is liable for the damage. The Noda Biyehuda (Tinyono 24) says that the Rambam concurs with the Ramah. However, the Shulchan Aruch (363, 7) only cites the opinion of Tosafos, ignoring the Ramah entirely.
The rationale for Tosafos is the subject of a dispute. One approach is advanced by the P’nei Yehoshua (20A, s.v. Venereh). He explains that in principle everyone should pay for a benefit he derived from use of someone else’s property. The reason we rule that one is not required to pay if the owner didn’t suffer any loss is because if a person is able to help someone and suffers no loss, it is middas sedom if he doesn’t do so. Thus, since we force people not to act in a manner which is considered middas sedom, we do not make the occupant pay. However, if the owner suffers even a small loss, it is no longer middas sedom if he denies the use of his property, and therefore the one who used the property without permission must pay for his benefit.
Thus, if while sleeping on the floor you slightly damaged the property you would have to pay the benefit you derived from sleeping on the floor. This is obviously less than the cost to rent a bed for the night. But if there are people who rent places to sleep on the floor you would have to pay the amount they charge, according to the Shulchan Aruch.
An additional consideration is whether you would have to pay the entire benefit in case you used the water of the owner to wash your hands in the morning since the owner had a slight loss, namely, the cost of the water (if it costs more than a pruto, about five agorot). Rav Naftoli Nussbaum ruled that one would not have to pay for the entire benefit since the use of the water is not related to your use of the space in order to sleep and you would just need to pay for the use of the water.
Another reason why one would not have to pay for the entire benefit can be derived from the rationale of the P’nei Yehoshua. The Kesef Kodoshim (siman 315) rules that when one certainly will pay for any damages it is considered middas sedom if one denies use of his property because of the possibility that the user will damage his property. Therefore, it stands to reason that if you immediately pay the cost of the water you would not have to pay the entire benefit, according to the P’nei Yehoshua.