Thoth becomes the vicar of Ra; from “The Book of Celestial Cow” (E. A. Wallis Budge)
Tehuti, or Thoth, who invented letters, mathematics, etc. He was the “heart of Ra”, the scribe of the gods, and he uttered the words which created the world; he composed the “words of power,” or magical formulae which were beneficial for the dead, and the religious works which were used by souls in their journey from this world to the next.
“…And the majesty of this god said, “Call to me the god Thoth,” and one brought the god to him forthwith. And the Majesty of this god said unto Thoth, “Let us depart to a distance from heaven, from my place, because I would make light and the god of light (Khu) in the Tuat and [in] the Land of Caves. Thou shalt write down [the things which are] in it, and thou shalt punish those who are in it, that is to say, the workers who have worked iniquity (or, rebellion). Through thee I will keep away from the servants whom this heart [of mine] loatheth. Thou shalt be in my place (ast) ASTI, and thou shalt therefore be called, O Thoth, the ‘Asti of Ra.’ Moreover, I give thee power to send (hab) forth …..; thereupon shall come into being the Ibis (habi) bird of Thoth. I moreover give thee [power] to lift up thine hand before the two Companies of the gods who are greater than thou, and what thou doest shall be fairer than [the work of] the god Khen; therefore shall the divine bird tekni of Thoth come into being. Moreover, I give thee [Power] to embrace (anh) the two heavens with thy beauties, and with thy rays of light; therefore shall come into being the Moon-god (Aah) of Thoth. Moreover, I give thee [power] to drive back (anan) the Ha-nebu; therefore shall come into being the dog-headed Ape (anan) of Thoth, and he shall act as governor for me. Moreover, thou art now in my place in the sight of all those who see thee and who present offerings to thee, and every being shall ascribe praise unto thee, O thou who art God.”
Ra next sent for the god Thoth, and when he came into the presence of Ra, he invited him to go with him to a distance, to a place called “Tuat,” i.e., hell, or the Other World, in which region he had determined to make his light to shine. When they arrived there he told Thoth, the Scribe of Truth, to write down on his tablets the names of all who were therein, and to punish those among them who had sinned against him, and he deputed to Thoth the power to deal absolutely as he pleased with all the beings in the Tuat. Ra loathed the wicked, and wished them to be kept at a distance from him. Thoth was to be his vicar, to fill his place, and “Place of Ra,” was to be his name. He gave him power to send out a messenger (hab), so the Ibis (habi) came into being. All that Thoth would do would be good (khen), therefore the Tekni bird of Thoth came into being. He gave Thoth power to embrace (anh) the heavens, therefore the Moon-god (Aah) came into being. He gave Thoth power to turn back (anan) the Northern peoples, therefore the dog-headed ape of Thoth came into being. Finally Ra told Thoth that he would take his place in the sight of all those who were wont to worship Ra, and that all should praise him as God. Thus the abdication of Ra was complete.
Quoted from: “Legends of the Gods; The Egyptian Texts, edited with Translations”, by E. A. Wallis Budge, London, 1912