Samyukta Āgama (2) 28
Māra transforms himself into a snake to frighten the Buddha
At that time, in the middle of the night, the World-honored One was practicing walking meditation in the open. Having washed his feet, he entered his silent abode, sat upright and focused his attention in front of him. Then, King Māra the Bad had this thought: “The renunciant Gotama staying in Rājagaha on Gijjhakūṭa Mountain is practicing walking meditation in the open. I should go and disturb him.”
At that time King Māra changed into a huge snake that was long and thick like a large boat. With a pair of eyes glittering brightly like a bronze bowl from the land of Kosala, tongue flicking in and out like lightning and breath heaving like thunder, it stood before the Buddha and coiled its body around him. Then, it bent its neck forward, and lowered its head on to the head of the Buddha. The Buddha, who knew that this was Māra trying to disturb him, spoke this verse:
When King Māra heard the Buddha speak this verse he thought: “The Gotama renunciant knows my mind!” and he became deeply afraid. Depressed and dispirited, he made himself invisible and returned to his heavenly palace.