Can You Offer The Funeral Prayer in Absentia?
Question

What is the ruling on offering the funeral prayer for the deceased in absentia? If it is allowed, then should the funeral prayer be offered in absentia in all cases?
Praise be to Allah.Can you pray the Funeral prayer without the body?
It is proven in Al-Bukhari and Muslim that the Prophet (peace and blessings of Allah be upon him) came out to his companions the day the Negus, the king of Abyssinia (may Allah have mercy on him), died; told them the news of his death and he lined them up in rows and offered the funeral prayer.
This Hadith indicates that it is prescribed to offer the funeral prayer in absentia, but some of the scholars, such as the Hanafis and Malikis said that this applied only to the Messenger (peace and blessings of Allah be upon him), and it is not prescribed for anyone else to offer the funeral prayer in absentia.
The majority of scholars rejected that, however, and said that whether or not a thing applies only to the Prophet (peace and blessings of Allah be upon him) can only be proven with evidence, and the basic principle is that the ummah is enjoined to follow the example of the Prophet (peace and blessings of Allah be upon him).
Can the funeral prayer be offered in absentia in all cases?
The scholars who say that it is prescribed to offer the funeral prayer in absentia differed as to whether this should be done in all cases or not. All of them quoted the fact that the Prophet (peace and blessings of Allah be upon him) offered the funeral prayer for the Negus in absentia as evidence.

The Shafi`is and Hanbalis are of the view that it is prescribed to offer the funeral prayer in absentia for everyone who dies away from his hometown, even if the funeral prayer is offered for him in the place where he dies.
The second view is that it is prescribed to offer the funeral prayer in absentia if the deceased had benefited the Muslims in some way, such as a scholar, a mujahid or a rich man from whose wealth the people benefited, and so on.

This view was narrated from Imam Ahmad, and it is the view favoured by Shaykh As-Sa`di, and is mentioned in fatwas issued by the Standing Committee.

The third view is that it is prescribed to offer the funeral prayer in absentia so long as the funeral prayer has not been offered for the deceased in the place where he died. If the funeral prayer has been offered for him, then it is not prescribed to offer the funeral prayer for him in absentia.

This view is the other view narrated from Imam Ahmad. It was also favoured by Shaykh Al-Islam Ibn Taymiyah and his student Ibn Al-Qayyim, and among later scholars it was favoured by Shaykh Ibn `Uthaymin (may Allah have mercy on him).
Scholarly comments on offering funeral prayer in absentia
There follow some comments of the scholars on this issue:
Al-Khurshi – a Maliki scholar – (may Allah have mercy on him) said (2/142): “The fact that the Prophet (peace and blessings of Allah be upon him) offered the funeral prayer for the Negus (in absentia) is one of the things that applied only to him.”
Something similar was stated in Bada’i` As-Sana’i` by Al-Kasani – a Hanafi scholar – (may Allah have mercy on him) (1/312).
An-Nawawi (may Allah have mercy on him) said in Al-Majmu` (5/211): “Our view is that it is permissible to offer the funeral prayer for one who died away from his hometown, but Abu Haneefah disallowed it. Our evidence is the Hadith about the Negus, which is authentic and has no faults, and they do not have any valid answer to that.”
Ash-Shafi`i (may Allah have mercy on him) imposed a valid restriction on offering the funeral prayer in absentia, which is that the one who offers the funeral prayer for the deceased should be one of those who would have offered the prayer for him the day he died.
Zakariya Al-Ansari (may Allah have mercy on him) said in Asna Al-Matalib (1/322): “Offering the funeral prayer for one who died away from his home town is only permissible for those who would have prayed for him the day he died.”
Shaykh Ibn `Uthaymin (may Allah have mercy on him) said: “But some of the scholars imposed a valid restriction and said: so long as the one who has been buried died at a time when the one who is praying for him was qualified to pray .
For example: a man died twenty years ago, and a person who is thirty years old goes out and offers the funeral prayer for him – this is valid, because when the man died, the one who was praying for him was ten years old, so he is qualified to offer the funeral prayer for the deceased.
Another example: A man died thirty years ago, and a person who is twenty years old goes out and offers the funeral prayer for him. This is not valid, because the one who is praying did not exist at the time when the man died, so he is not qualified to offer the funeral prayer for him.
So it is not prescribed for us to offer the funeral prayer over the grave of the Prophet (peace and blessings of Allah be upon him). We have never known any of the scholars saying that it is prescribed for a person to offer the funeral prayer at the grave of the Prophet (peace and blessings of Allah be upon him) or at the graves of the Sahabah, rather what is prescribed is to stand and say Du`a for them.”
Ibn Qudamah (may Allah have mercy on him) said in Al-Mughni (2/195):
“It is permissible to offer the funeral prayer in absentia for one who is in another land, by forming the intention then turning to face the qiblah, and offering the funeral prayer as one would offer it for one who is present, whether the deceased is lying in the direction of the qiblah or not, and whether there is a short distance between the two places or not. This is the view of Ash-Shafi`i.”
Al-Mardawi (may Allah have mercy on him) said in Al-Insaf (2/533): “The funeral prayer may be offered in absentia with the right intention. This is our view with regard to all cases (i.e., whether the funeral prayer has already been offered for him or not, and whether he benefited the Muslim masses or not). This is the view of the majority of our companions and many of them were definite about that. And it was narrated from Imam Ahmad that it is not permissible to offer the funeral prayer in absentia. And it was said that the funeral prayer may be offered if it has not yet been offered, otherwise it should not be done. This is the view favoured by Shaykh Taqiy Ad-Din and Ibn `Abd Al-Qawiy.”
Shaykh Al-Bassam (may Allah have mercy on him) said in Nayl Al-Ma’arib (1/324):
“The scholars differed concerning offering the funeral prayer in absentia. Abu Haneefah and Malik and their followers were of the view that it is not prescribed, and they responded to the story of the Negus and the prayer that was offered for him by noting that this was something that applied only to the Prophet (peace and blessings of Allah be upon him).
Ash-Shafi`i and Ahmad (may Allah have mercy on them) and their followers are of the view that it is prescribed, and they quote two authentic Hadiths as evidence. Whether or not a thing applies only to the Prophet (peace and blessings of Allah be upon him) requires evidence, and there is no evidence in this case. Shaykh Al-Islam (may Allah have mercy on him) adopted a middle path and said: If the funeral prayer has not been offered for the absent one, as in the case of the Negus, then it may be offered, but if the funeral prayer has been offered for him, then the communal obligation (Fard Kifayah) no longer applies to the Muslims.
This view was also mentioned in an authentic narration from Imam Ahmad, which was classed as authentic by Ibn Al-Qayyim in Al-Hadiy, because some of the Companions died at the time of the Prophet (peace and blessings of Allah be upon him) when they were away from him, and there is no proof that he offered the funeral prayer for any of them in absentia.
Shaykh Al-Islam (may Allah have mercy on him) narrated that Imam Ahmad said: If a righteous man dies, then the funeral prayer may be offered for him, and he quoted as evidence the story of the Negus.
This view was favoured by our Shaykh `Abd Ar-Rahman As-Sa`di (may Allah have mercy on him), and this is what is done in Najd, where they offer the funeral prayer for any virtuous person who benefited the Muslims, and they leave anybody else. Prayer in this case is recommended.”
Al-Khattabi said:  “The funeral prayer should not be offered in absentia except if a person dies in a land where there is no one to offer the prayer for him. Ar-Ruyani (may Allah have mercy on him) – a Shafa`i scholar – favoured this view, and Abu Dawud used a heading in As-Sunan that referred to this meaning when he said: “Chapter on offering the funeral prayer for a Muslim living among the polytheists in another land.” Al-Hafidh (may Allah have mercy on him) said: This is possibly correct.”(End quote from Fat-h Al-Bari)
The Standing Committee (8/418) was asked: Is it permissible for us to offer the funeral prayer for the deceased in absentia as the Prophet (peace and blessings of Allah be upon him) did for his beloved the Negus, or did that apply only to him?
They replied:
“It is permissible to offer the funeral prayer in absentia because the Prophet did that, and this does not apply only to him, because his companions (may Allah be pleased with them) also prayed for the Negus with him, and because the basic principle is that things do not apply only to the Prophet (peace and blessings of Allah be upon him), but that should be done only for those who made a contribution to Islam, not for everyone.”
Shaykh Ibn `Uthaymin (may Allah have mercy on him) was asked:
“It is proven that the Messenger (peace and blessings of Allah be upon him) offered the funeral prayer for the Negus in absentia, and the reason for that was that there were no Muslims there who could pray for him. Now the Muslims may die in groups and there is no one to pray for them, as happens nowadays, and there is certainty that no one has offered the funeral prayer for them?
He replied: If you are certain that no one has offered the funeral prayer for them, then pray for them, because the funeral prayer is a communal obligation, but probably his family have offered the funeral prayer for him, because the funeral prayer may be offered by one person. Whatever the case, if you are certain that nobody has offered the funeral prayer for him, then you have to offer the prayer for him, because it is a communal obligation which must be discharged.”(End quote from Majmu` Fatawa Ash-Shaykh Ibn `Uthaymin, 17/149)
From the above it is clear that offering the funeral prayer in absentia is prescribed, because it is proven that the Prophet (peace and blessings of Allah be upon him) and his companions prayed for the Negus, and there is no evidence to prove that this is something that applied only to the Prophet (peace and blessings of Allah be upon him). But the soundest views on this matter are two:

That the funeral prayer should not be offered in absentia except for one for whom it has not been offered.
That the funeral prayer may be offered in absentia for one who has benefited the Muslims, such as a scholar from whose knowledge the people benefited, or a businessman from whose wealth the people benefited, or a mujahid from whose Jihad the people benefited, and so on.

And Allah knows best.