(a) The taxes imposed on a complex trust for a taxable year which would not have been payable by the trust if amounts deemed under section 666 to have been distributed in the year had in fact been distributed in the year are not allowable as a refund to the trust but are allowable as a credit against the tax of the beneficiaries to whom the amounts described in section 666(a) are distributed.
(b) The credit to which a beneficiary is entitled under section 668(b) is allowed for the taxable year in which the accumulation distribution (to which the credit relates) is required to be included in the gross income of the beneficiary. Any excess over the total tax liability of the beneficiary is treated as an overpayment of tax by the beneficiary.
(c) The beneficiary is entitled to a portion of the credit described in paragraph (a) of this section in the ratio which the amount of the accumulation distribution to him bears to the accumulation distributions to all the beneficiaries.