1) PAYING OFF THE DEBT OF ONE'S OWN CREDITOR
QUESTION: Rami bar Chama discusses a case in which Reuven sells a field to Shimon and lets Shimon keep the money he owes for the field as a loan. Reuven dies and his property is inherited by his children. When Reuven's own creditor later comes to collect the field from Shimon, Shimon does not give the field itself to the creditor, but instead he gives him the value of the field (in cash). Shimon then goes to Reuven's heirs to demand repayment for having paid off their father's debt for them. Reuven's heirs rightfully claim that they are exempt from reimbursing Shimon because only land which heirs inherit is Meshubad (collateralized) for the payment of their father's debt, but not Metaltelin or cash which they inherit. Accordingly, Shimon has no recourse to reclaim his money.
Rava comments that if Shimon is cunning, he can avoid a loss by paying back his own debt to Reuven by returning the land to Reuven's heirs. Once the heirs have land that belonged to Reuven, Shimon may collect that land as repayment for Reuven's debt to him.
Why does the Gemara mention that Shimon gave specifically money to Reuven's creditor? What difference does it make if Shimon gave the land or if he gave money to the creditor? In either case, Reuven now has the responsibility to reimburse Shimon for the debt which Shimon paid for him! Whether Shimon gave land or cash, a mutual debt is created wherein Shimon owes money to Reuven and Reuven owes money to Shimon, and Rava's statement -- as to how Shimon can avoid a capital loss -- applies just the same.
ANSWERS:
(a) TOSFOS (DH u'Payesei) explains that Rami bar Chama intends to teach an additional Chidush. If he would have said that when Shimon pays Reuven's creditor with land he is not entitled to compensation from Reuven's children (because they do not have any land to give him), that would have been obvious -- Shimon cannot collect the "Achrayus" from Reuven's children if they did not inherit land! Shimon's debt to Reuven, on the other hand, remains and he is obligated to pay the children the value of the land.
However, now that he pays the creditor with the value of the field (i.e. cash), one might have thought that he is not relying on being reimbursed due to the "Achrayus" on his field, but rather he is giving the original money that he kept back when he purchased the field. This is Reuven's own money which Shimon happens to be holding. That is, Shimon pays Reuven's money to Reuven's creditor on Reuven's behalf, like a Shali'ach. Therefore, one might have thought that Shimon is exempt from paying his old debt to the children since he passed that money on to Reuven's creditors, as though he was a middleman for Reuven, instead of giving it to the children. Accordingly, Shimon comes out even.
In fact, TOSFOS (91b, DH Reuven; Pesachim 31a, DH b'Achrayus) and other Rishonim point out that if -- at the time of the purchase of the land -- Shimon did not keep the money he owed for the land as a loan (i.e. he did not set a later time for payment) but he merely delayed paying Reuven, the money which he would now hold would actually belong to Reuven, and the above ruling would be valid. After Reuven's death, Shimon could give that money straight to the creditor as a way of giving the money to Reuven. However, since he converted the money he owed for the field into a loan, he no longer may assert that he has Reuven's money in his hands. Rather, he has a debt to Reuven. Therefore, Reuven's children may say to Shimon, "We hereby demand the money that you owe us. You gave your own money to our father's creditor, and not our father's money, and we are not obligated to cover the guarantee for you because we do not have any land."
This also seems to be the intention of RASHI.
(b) The MAHARAM CHALAVAH (Pesachim 31a) explains that if the money for the land was not converted into a loan but Shimon merely delayed paying Reuven, the reason why Shimon could pay the creditor and thereby exempt himself from paying Reuven's children is not because he simply is holding Reuven's money in his hands, but because he still has the option to withdraw from the transaction altogether. Since he has not yet paid for the land, the deal has not been consummated. Shimon may say to Reuven's children, "I do not have to pay you the value of the field anymore, because I am withdrawing from the deal and am not buying the land." He keeps the land, though, as reimbursement for Reuven's debt that he paid to the creditor.
The Gemara mentions that Shimon paid money to the creditor, instead of giving the field itself, only to teach the Halachah in a case in which he did not convert the money he was holding back into a loan. If the money he was holding was not a loan, then not only could Shimon retract the deal, give the field to the creditor, and not pay Reuven for the field, but he could even give the value of the field (in cash) to the creditor and claim that he never bought the field from Reuven, and owe nothing to Reuven's children. (Why, then, does he keep the field, if he cancelled the purchase? He keeps the field because he claims that when he paid Reuven's money to the creditor, it was as though he gave the field to the creditor and then bought it back.) In summary, when the Gemara says that Shimon paid Reuven's creditor with money, it teaches what the Halachah would be in a case in which Shimon did not convert the value of the field into a loan.
2) PAYING BACK A DEBT WITH LAND
QUESTION: Rava teaches that if Shimon is clever, he will pay back the debt he owes to the heirs of Reuven with land and not with money. The heirs then will have land with which to pay their debt to Shimon.
What right does Shimon have to choose to pay his debt with land? The Gemara earlier (86a) says that when one repays a loan, he must repay with cash (if he has any) and not with land.
ANSWERS:
(a) RASHI (Pesachim 31a, DH Iy Pike'ach) says that he could claim that he has no money but only land.
(b) TOSFOS (DH Iy, see also MAGID MISHNEH, Hilchos Malveh v'Loveh 11:10) writes that when a debtor will incur a loss if he pays back his debt with cash, then he is permitted to pay back with land. Only when he will incur no loss by paying back with cash is he required to do so. In the case of the Gemara here, if Shimon pays back with cash, he will incur a loss because the heirs of Reuven are not obligated to pay back their father's debt with cash.
(c) The RA'AVAD, cited by MAHARAM CHALAVAH (Pesachim 31a) and others, explains that Rava maintains that if Shimon bought land from Reuven on credit, even though he has converted the money that he owes for the land into a loan, he may cancel the purchase and give back the same land that Reuven sold to him. Consequently, when he returns the land he cancels the loan and does not have to pay cash for any purchase; he merely gives back the land which he decided not to buy. Shimon is then entitled to reclaim the land as reimbursement for paying money on Reuven's behalf to Reuven's creditor.

OTHER D.A.F. RESOURCES
ON THIS DAF