Funerary cult
A funerary cult is a body of religious teaching and practice centered on the veneration of the dead, in which the living are thought to be able to confer benefits on the dead in the afterlife or to appease their otherwise wrathful ghosts. Rituals were carried on for the benefit of the dead, either by their relatives or by a class of priests appointed and paid to perform the rites. These rituals took place at the tombs of the dead themselves or at mortuary temples appointed to this purpose. Funerary cults are found in a wide variety of cultures. Notable cults

Egypt
Funerary cults are especially associated with ancient Egypt, where it was common for royalty, those associated with royalty, cats, and the wealthy to be mummified. This practice was done so as to preserve their bodies for the journey to the afterlife. The deity Osiris, who was the dying and reviving god and Lord of the Egyptian afterlife, was usually depicted as a mummy in Egyptian art. Also at Bubastis, where Bast was worshiped, there was a massive cat cemetery. Cats were also thought to journey to the afterlife, usually to join their owners. These needed their own material goods for this journey, such as food. Roman Empire
The Roman Empire also had a funerary cult, revolving around Dionysus. Dionysus, (along with being lord of wine and parties) had been reborn many times and had rescued his mother Semele from the Underworld (the Roman afterlife, ruled by Hades). Each Roman God had his or her own clique of devotees, and it was thought that Dionysus could protect his initiates from death. He was also one of the Gods associated with plants (grapes in particular) and harvest. He was occasionally depicted in conjunction with other Gods (representatives of rebirth or plants of some kind) to indicate the dead also participated in the rejuvenation of the seasons. Mesopotamia
In Sumer, Assyria, and Babylonia, funerary cults were called kispu. This funerary cult mostly revolved around caring for deceased kin, with a specific family member assigned to providing for a specific ghost. The ghosts were provided with food and other goods, however the provision of clean water was of particular importance. Both deceased men and women were supposed to receive this care. Without this care, the dead had the potential to become a malicious supernatural force. With this care, the dead family continue to participate in the lives of the living family. Also, the practice of recycling the names of the deceased allowed for familial continuity. In Assyria, this was done by any consanguineal kin. A Babylonian variation of this cult treats the veneration of the dead as an extension of the veneration for parents. Offspring were responsible for this care. Scholar Miranda Bayliss had stated the function of this cult was to alleviate guilt and other tensions from the death of the deceased and form solidarity and continuity within the family. Typically only close kin received this care. When ancestors beyond the individual's grandparents were venerated, it was done at large gatherings of extended kin groups. This also functioned to promote solidarity within the larger kin group. Greece
The ancient Greek hero cult was also a funerary cult; in the original sense, a hero was a deified or semi-divine ancestor, worshiped at a shrine for his power to assist the living. The ancient Greek religion had three main aspects: the Gods, the heroes, and the dead. The dead are powerless and the Gods all-powerful, while the heroes are dead (live only in legend and memory) and are powerful. Heroes occupy a liminal space between the Gods and mortals. Mortals sacrificed livestock and plants at Heroes' tombs to intervene and commune with the Gods on their behalf. Italian Peninsula
The Samnites and Etruscans of the Italian peninsula painted the underworld deities Aita, Vanth, Phersipnei, and Letham on the walls of tombs. See also
Ancestor worship
Baptism for the dead
Funeral
Grave goods
Greco-Roman mysteries
Hungry ghost
Prayer for the dead
Purgatory

References

Religion and death
Death customs
Anthropology of religion