We often evaluate the self and others from social comparisons. We feel envy when the target person has superior and self-relevant characteristics. Schadenfreude occurs when envied persons fall from grace. To elucidate the neurocognitive mechanisms of envy and schadenfreude, we conducted two functional magnetic resonance imaging studies. In study one, the participants read information concerning target persons characterized by levels of possession and self-relevance of comparison domains. When the target person's possession was superior and self-relevant, stronger envy and stronger anterior cingulate cortex (ACC) activation were induced. In study two, stronger schadenfreude and stronger striatum activation were induced when misfortunes happened to envied persons. ACC activation in study one predicted ventral striatum activation in study two. Our findings document mechanisms of painful emotion, envy, and a rewarding reaction, schadenfreude.