Gaya finds mention in the great epics, Ramayana and Mahabharata. In Mahabharat, the place has been identified as Gayapuri. Gaya derives its name from the mythological demon Gayasur (which literally means Gaya the holy demon), demon (asur, a Sanskrit word) and Gaya. Over its history dating millennia, the word asur got deleted and the name Gaya remained in currency.
A study of Gaya perhaps Cannot be completed without a refernce to the Gaya Mahatmya In Gaya Mahatmya.
And Gaya Mahatmya also speaks about the powerful demon Gayasur and how Lord Vishnu in his mace bearing form had persuaded the demon motionless with his body and how Lord Vishnu killed Gayasur, the holy demon by using the pressure of his foot over him and forming the panch kosi Gaya kshetra (The most pious land on earth),
And Gayasur was the creation of Brahma and his body with his head in the north covers the area from the BodhGaya on the south to Prethshilla on the north, and after his death many people have flocked to Gaya to perform shraddha or Pind daan sacrifices on his body to absolve the sins of their ancestors. And It was said that the Gayasura's body would continue to be known as Gaya Kshetra.
It is believed that this place has been blessed by purificatory powers.Hindus traditionally come here to perform Gaya Pind daan & Shraddha as well as Pitra-Dosh Pooja in Gaya to honour their parents or ancestors and people also participate in the massive get together who perform the final rites of their departed family members to freed from the agonies of Hell and sent to Heaven.
As we say the king of holy place is Prayag. The teacher of holy place is Pushkar. Thus Gaya Ji is called the soul of holy place. (it is written in Bedpuran) Gaya Ji is only one of the places where hindues worship their parents, ancestors with the Lord.