Segaki
The segaki (施餓鬼, "feeding the hungry ghosts") is a ritual of Japanese Buddhism, traditionally performed to stop the suffering of the gaki or muenbotoke (the dead who have no living relatives), ghosts tormented by insatiable hunger. Alternatively, the ritual forces them to return to their portion of hell or keeps the spirits of the dead from falling into the realm of the gaki. The segaki may be performed at any time, but traditionally performed as part of the yearly Urabone (ullambana、 उल्लम्बन) services in July to remember the dead and the segaki ritual for offering alms to specifically hungry gaki or muenbotoke, not for spirits of one's ancestor.
The ritual is held at Buddhist temples and there is a custom to place segaki-dana (rack for gaki) or gaki-dana (shelf for gaki) at home, present offerings (traditionally rice and water) for hungry ghosts who are wandering in this world as muenbotoke during Urabone or O-bon.
The segaki began as a way for Moggallana (Maudgalyayna), on instruction of his master, the Buddha Sakyamuni, to free his mother from gaki-do, the realm of the gaki. Alternatively, Sakyamuni ordered Moggallana to preach the Lotus Sutra or to travel to hell himself, a feat that resulted in the escape of all gaki into the world and necessitating the segaki to force them to return to their realm. Another story says that the student Ananda was told by a gaki that he would become one himself in three days; he thus had to feed strangers to prevent the transformation. In reality, the segaki is likely an adaptation of a Chinese festival to remember the dead.
The ritual is known as mataka dānēs in Sri Lanka.[1]