This paper discusses the background of feeding the hungry ghosts ( 施餓鬼 Se-gaki ) which is the ritual for them in modern Japanese temples by focusing on it in the Abhidharmamahāvibhāṣaśāstra ( 阿毘達磨大毘婆沙論 ) and the Dharani Sutra for Saving the Burning-Mouth Hungry Ghosts ( Skt: Pretamukhāgnivālāyaśarakāra-dhāraṇī; Chi: 佛說救拔焰口餓鬼陀羅尼經 ). "Se-gaki", also known as "O-se-gaki ( お施餓鬼 )" or "Se-gaki-e ( 施餓鬼会 )", is one of the most famous Buddhist rituals in Japan and is performed for hungry ghosts. It is a ceremony to send foods and merits to hungry ghosts in order to cure their hunger and make them cultivate themselves. There is an origin of this ritual in the Nikāya or the Āgama. This ritual is a topic in the Jñānaprasthānaśāstra ( 發智論 ) and the Abhidharmamahāvibhāṣaśāstra. It is argued that the reason why we can send something to hungry ghosts in the Jñānaprasthānaśāstra. The answer to this question is because of the nature of the realm of hungry ghost. The Abhidharmamahāvibhāṣaśāstra comments that its nature is like that of a bird flying in the sky. Furthermore, the Abhidharmamahāvibhāṣaśāstra argues that hungry ghosts can get food because they are near the ritual. This argument based on the theory of the outcome of one's own karma. Instead of giving food to hungry ghosts, they eat it themselves and get great merit. The Se-gaki in modern Japanese Buddhism is held based on Chinese translation of the Dharani Sutra for Saving the Burning-Mouth Hungry Ghost. The Dharani Sutra explains the origin of Se-gaki and the method of this ritual. There are some similarities between this sutra and the Abhidharmamahāvibhāṣaśāstra. Especially some merits of hungry ghost through rituals are very similar. On the other hand, the concept of Se-gaki in this sutra is different from that of the Abhidharmamahāvibhāṣaśāstra. The latter is based on the theory of the outcome of one's own karma, while the former is based on the Mahayana Buddhist theory of transfer of merit. This is an example of the development and evolution of "Se-gaki" in India. This point of view is the background for thinking about Se-gaki in the modern Japanese Buddhism.