The spirit receives reward or punishment (as the case may be) in the grave. But due to it's long relation with the body, the body also feels pain and is effected. Those people who say that it is of no use to visit the graves, for the spirit (Rooh) of the believer is not present there but is in 'wadi-us Salaam', this is not true. The answer to this ignorant talk is the tradition (Hadees) of Imam Ja'far as-Sadiq (A.S.) who says that Verily the Spirit (Rooh) of the believer is in 'Wadi-us-salaam, but it surely keeps an eye on what is happening in the grave. It also looks at the people who have come to visit his grave. Imam (A.S.) compares the spirit to the sun.. Even though the sun is not on the earth but is on the sky, the entire earth is illuminated by it's light, in the same manner the spirit is in Wadi-us-Salaam' but it keeps contact with the body.
The great Traditionist (Muhaddis) Sayyed Ne'matullah Jazaeri narrates an incident in his book "Anware No'maniyah" that once Shah Isma'il Safawi came to Karbala. He heard the people denying and doubting the faithfulness of Hurr bin Yazid-ar-Riyahi (one of the companions of Imam Husain, who was martyred in Karbala). He gave the order to dig the grave of Hurr.
When the grave of Hurr was opened, people saw the corpse of Hurr lying afresh. A kerchief was tied on his forehead, regarding which it is related, that on the day of 'Ashoora' (the tenth of Moharram), Imam Husain (A.S.) himself had tied a kerchief on the bleeding forehead of Hurr. Shah Isma'il ordered that the kerchief should be removed and given to him so as to be kept in his shroud. As soon as the kerchief was removed, blood started oozing from the forehead of Hurr, hence it was tied back. Shah Isma'il ordered another kerchief to be tied instead of it.
When this was done the blood ceased to stop flowing. The Shah was helpless and ordered the kerchief to remain at it's original place. He then acknowledged the faithfulness and high honour of Hurr. Then he ordered a Shrine to be erected on the grave.
In the same manner Shaikh Kulaini and Shaikh Sadooq (two great Shi'ah Ulamas)'s graves were opened, and their bodies were found fresh there in as if sleeping in peace. The Henna applied on the hands of Shaikh Sadooq also remained intact even after so much time. The signs of life were visible from his body.
On the other hand, when the spirits of the non-believers are being punished, their bodies are also effected. When Bani Abbas gained victory over Bani Ummayah and entered Damascus, they started exhuming their graves. When the grave of Yazid ibne Mu'awiyah was opened, only a lump of mud was found instead of his body. When a person was being buried in a graveyard in the city of Qum, a flame of fire erupted from his grave which destroyed all it's surroundings. In Pakistan too many incidents have taken place which are written in newspapers. (Ma'ad)
* Manazil Al-Akherah. By SHAIKH ABBAS BIN MOHAMMAD REZA AI-QUM. Chapter 3. Published in Iran, Qum.