The segaki(施餓鬼?, "feeding the hungry ghosts") is a ritual of Japanese Buddhism, traditionally performed to stop the suffering of the gaki, ghosts tormented by insatiable hunger. Alternatively, the ritual forces the gaki to return to their portion of hell or keeps the spirits of the dead from falling into the realm of the gaki. Today, the ceremony also gives participants an opportunity to remember those who have died and to symbolically sever ties with past sins. The segaki may be performed at any time, but it is traditionally part of the O-Bon, a festival held every year in July or August to remember the dead. Due to Western influence, however, the ceremony is today often held around Halloween and Mexican Day of the Dead, which are similarly devoted to remembrance of the deceased, and though less emphasized in the modern period, the potential placation of their spirits.

The segaki is normally preceded by several days of meditation. Participants then gather at a temple and present offerings (traditionally rice and water) on an altar placed out of sight of any statues or images of Buddhas or Bodhisattvas. Participants then approach the altar in pairs, one burning incense and the other sprinkling water from a pine branch. Participants call the gaki (and all "unresolved karma" in some modern ceremonies) to consume the offerings. Participants then light a fire and burn pieces of paper on which they have written the names of the deceased, sins, or things they wish to "leave behind" or resolve. Participants then say prayers and chant dharani, scriptures, or names of Buddhas and Bodhisattvas. Someone may also read aloud the names of people who have died over the past year. In some modern segaki, the participants then eat the food offering after the ritual is completed.

According to legend, 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. Japanese monks used the time as a chance to meditate upon and confess their sins, and over time, the modern ritual took shape from this.