Sahih Muslim Book 4, Hadith Number 2029.

Chapter : The dead body is punished for the lamentation of his family.

‘Amra daughter of ‘Abd al Rahman narrated that she heard (from) ‘Aisha and made a mention to her about ‘Abdullah b. ‘Umar as saying: The dead is punished because of the lamentation of the living. Upon this ‘Aisha said: May Allah have mercy upon the father of ‘Abd al-Rahman (Ibn ‘Umar). He did not tell a lie, but he forgot or made a mistake. The Messenger of Allah (may peace be upon him) happened to pass by a (dead) Jewess who was being lamented. Upon this he said: They weep over her and she is being punished in the grave.