All perfect praise be to Allah, The Lord of the Worlds. I testify that none is worthy of worship except Allah and that Muhammad, , is His slave and messenger.
According to the Sharee'ah, there is no prayer for the in the manner described in the question. In fact, the described manner is considered a Bid'ah (religious innovation). The prescribed prayer for the deceased is the known funeral prayer, in which the worshippers recite Al-Faatihah only, and it should be performed outside the graveyard. It is permissible, however, for those who missed the funeral prayer to perform it inside the graveyard.
The Prophet, , urged the bereaved family and others to seek forgiveness for the deceased and implore Allah, The Exalted, to make him/her steadfast while being questioned by the angels in the grave. ‘Uthmaan ibn ‘Affaan,
, narrated: "Whenever the Messenger of Allah, , finished the burial of a dead person, he would stand by the grave and say: ‘Seek forgiveness for your brother and pray for him to be steadfast; he is now being questioned.'" [Abu Daawood]
Allah Knows best.