Magicians and Snake-Charmers
When Ra had made a heaven for himself, and had arranged for a continuance of life on the earth, and the welfare of human beings, he remembered that at one time when reigning on earth he had been bitten by a serpent, and had nearly lost his life through the bite. Fearing that the same calamity might befall his successor, he determined to take steps to destroy the power of all noxious reptiles that dwelt on the earth.
With this object in view he told Thoth to summon Keb, the Earth-god, to his presence, and this god having arrived, Ra told him that war must be made against the serpents that dwelt in his dominions. He further commanded him to go to the god Nu, and to tell him to set a watch over all the reptiles that were in the earth and in water, and to draw up a writing for every place in which serpents are known to be, containing strict orders that they are to bite no one.
Though these serpents knew that Ra was retiring from the earth, they were never to forget that his rays would fall upon them. In his place their father Keb was to keep watch over them, and he was their father for ever.
As a further protection against them Ra promised to impart to magicians and snake-charmers the particular word of power, hekau, with which he guarded himself against the attacks of serpents, and also to transmit it to his son Osiris.
Thus those who are ready to listen to the formulae of the snake-charmers shall always be immune from the bites of serpents, and their children also. From this we may gather that the profession of the snake-charmer is very ancient, and that this class of magicians were supposed to owe the foundation of their craft to a decree of Ra himself.
E.A. Wallis Budge, Legends of the Gods: The Egyptian Texts, edited with Translations, London, 1912. (No page numbers are given in my edition).