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.