A companion had two wives. He divorced one of them. A little later he died. The divorced woman claimed a share in the property of her late husband. The suit was contested by the other wife on the grounds that the plaintiff could not claim a share as she had been divorced. It transpired that the husband had died within three months of giving the divorce, and since the divorce the divorced wife did not have more than two monthly courses. Ali accordingly awarded her a share in the property of her husband
"When a person dies, his works end, except for three: ongoing charity, knowledge that is benefited from, and a righteous child who prays for him."
Prophet Mohammed (PBUH)
"The best of what a man leaves behind are three: a righteous child who supplicates for him, ongoing charity the reward of which reaches him, and knowledge that is acted upon after him."
Sunan Ibn Mājah
"Every day two angels come down from Heaven and one of them says, 'O Allah! Compensate every person who spends in Your Cause,' and the other (angel) says, 'O Allah! Destroy every miser.'"
Sahih Bukhari