This is shown by MRI scans which show this “warm-glow effect” in the reward centers of the brain. For example, some experiments have been conducted in which a group of people are given money, and half of them are required to spend it on themselves while half are required to spend it on other people.
Contrary to their own expectations, the half who spent the money on others consistently get more pleasure out of the experience than their non-altruistic colleagues.
Reference: Dunn, Elizabeth et al (2008). "Spending Money on Others Promotes Happiness", Science 319.