Although Catholic doctrine denies that the imputed righteousness of Christ is sufficient to save sinners in this life, it does allow the imputation of righteousness from earthly sinners to those in purgatory. Candles are lit, prayers are prayed, and Masses are said for the dead. Supposedly the righteousness earned via the sacrament is imputed to the person in purgatory, and that shortens his or her stay there.
John MacArthur