The legend associated with Gaya and the importance of performing Shraddha (श्राद्ध) therein is contained in the Vayu Purana and runs as follows: There was once an Asura, by name Gaya, a demon of giant size who, by dint of long and austere penance, pleased the gods and obtained from them the boon that whoever saw or touched him was immediately admitted to Heaven. Numerous people touched his body and reached Heaven. Yama, the lord of Hell, found his kingdom soon emptied and was alarmed that his own office may come to an end. The gods then assembled in council and devised a plan to overpower Gayasur. They approached him and asked him to lend his pure and holy body as a place of sacrifice. To this Gayasur consented and lay down with his head resting on the site where the old city of Gaya is situated. When the sacrifice was performed and the giant made an effort to rise, Yama placed a sacred rock on his head, and all the gods sat on him and began to crush him. This did not suffice to quieten the giant. He said: “O Gods, if you will not leave your perch, I will not make any more effort to rise. Only be pleased to grant me this boon that this spot shall be named after me and celebrated as holy Gaya, the holiest of holies, and that whosoever offers pind (पिण्ड) here shall go to Heaven with his ancestors and progeny.” Vishnu consented and placed his feet on a pedestal that rested on the body of the giant. This is the origin of the Vishnupad Temple, where upon the silver-encrusted pedestal marked with the footprints of Vishnu, pindas are offered.
The importance of performing Shraddha in Gaya is mentioned in almost all the Puranas (पुराण). Thus the Markandeya Purana says: "Flesh of the rhinoceros, turmeric, and soma juice and a Shraddha performed at Gaya, without doubt, yield the ‘pitras’ (ancestors) endless satisfaction."
There are said to be some forty five places or centers in and around Gaya, comprising an area five miles north-west and to seven miles south, wherein the highly religious people should offer pindas. First, there is the Phalgu or Nairanjana River, which, even when silted up, is believed to be fed by a perennial spring underneath, the Vaitarani (वैतरणी) of Hindu mythology, on whose banks it is obligatory to perform the sacred rites.
Then there are the spots marked by the Akshayavat or the Imperishable Banyan; the Pret Shila (प्रेतशिला) where men, whose relatives have died by poison or violence and have, therefore, gone to the realm of the unholy spirits, must offer pindas; the Brahma Yoni, the sacred spot out of which issued Brahma the Self-Begotten; the Ram Shila where Ram performed the obsequies of his ancestors. The shrines of Brahma Yoni and Ram Shila (रामशिला) are perched picturesquely on the tops of two hills that rise on either side of the city of Gaya and dominate the country around.
There are forty five more significant places (excluding Vishnupad Temple) where the devout offer pindas. The most sacred, the most important place where the devout Hindu should offer the pindas to his ancestors is the Vishnupad Temple. It is by performing the Shraddha here on Vishnu’s footprint that the devout pilgrim gets the great and maximum merit that the place is capable of giving. Though most startling stories are told of the Gayawalis (priests) and their avarice and merciless methods for obtaining money, the pilgrimage and the finale constitute one of the most solemn spectacles known anywhere.
Surrounded by Gayawalis, the devout pilgrim, with trembling hands tied round with a garland of flowers, offers the pindas one by one accompanied by the recitation of mantras to his ancestors. The combined filial devotion and religions awe and hope make it one of the most solemn and inspiring rites known to any mundane religion; and according to faith, it bestows on the performer "long life, wisdom, wealth, knowledge, and final emancipation".