Except as provided in subsection (b) or (c) of this section, an entity that is liable with the debtor on, or that has secured, a claim of a creditor against the debtor, and that pays such claim, is subrogated to the rights of such creditor to the extent of such payment.
Such entity is not subrogated to the rights of such creditor to the extent that—
a claim of such entity for reimbursement or contribution on account of such payment of such creditor’s claim is—
(A) allowed under section 502 of this title;
(B) disallowed other than under section 502(e) of this title; or
(C) subordinated under section 510 of this title; or
(2) as between the debtor and such entity, such entity received the consideration for the claim held by such creditor.
The court shall subordinate to the claim of a creditor and for the benefit of such creditor an allowed claim, by way of subrogation under this section, or for reimbursement or contribution, of an entity that is liable with the debtor on, or that has secured, such creditor’s claim, until such creditor’s claim is paid in full, either through payments under this title or otherwise.
(Pub. L. 95–598, Nov. 6, 1978, 92 Stat. 2585; Pub. L. 98–353, title III, § 450, July 10, 1984, 98 Stat. 375.)