The wisest of the Egyptian gods was Thoth (Djhuty, Djehuty, Tehuty), the baboon and ibis god of the moon. Thoth was the god who overcame the curse of Ra, allowing Nut to give birth to her five children, with his skill at games. It was he who helped Isis work the ritual to bring Osiris back from the dead, and who drove the magical poison of Set from her son, Horus with the power of his magic. He was Horus' supporter during the young god's deadly battle with his uncle Set, helping Horus with his wisdom and magic. It was Thoth who brought Tefnut, who left Egypt for Nubia in a sulk after an argument with her father, back to heaven to be reunited with Ra.
When Ra retired from the earth, he appointed Thoth and told him of his desire to create a Light-soul in the Duat and in the Land of the Caves, and it was over this region that the sun god appointed Thoth to rule, ordering him to keep a register of those who were there, and to mete out just punishments to them. Thoth became the representation of Ra in the afterlife, seen at the judgement of the dead in the 'Halls of the Double Ma'at'.
The magical powers of Thoth were so great, that the Egyptians had tales of a 'Book of Thoth', which would allow a person who read the sacred book to become the most powerful magician in the world. The Book which "the god of wisdom wrote with his own hand" was, though, a deadly book that brought nothing but pain and tragedy to those that read it, despite finding out about the "secrets of the gods themselves" and "all that is hidden in the stars".
He was one of the earlier Egyptian gods, thought to be scribe to the gods, who kept a great library of scrolls, over which one of his wives, Seshat, the goddess of writing, was thought to be mistress. The god born of this union was called Hornub. He was associated by the Egyptians with speech, literature, arts, learning. He, too, was a measurer and recorder of time, as was Seshat. Believed to be the author of the spells in The Book of the Dead and a much later work, the Book of Breathings, he was a helper (and punisher) of the deceased as they try to enter the underworld. In this role, his wife was Ma'at, the personification of order, who was weighed against the heart of the dead to see if they followed ma'at during their life. At Khmunu (Hermopolis) he was wed to a goddess of protection called Nehmauit (Nahmauit, Nehmetaway), 'She Who Uproots Evil', with whom he fathered the god Neferhor.
Thoth was usually depicted as an ibis headed man or as a full ibis, or with the face of a dog-headed baboon and the body of a man or, again, as a full dog-headed baboon. The ibis, it is thought, had a crescent shaped beak, linking the bird to the moon. The dog-headed baboon, on the other hand, was a night animal that was seen by the Egyptians who would greet the sun with chattering noises each morning just as Thoth, the moon god, would greet Ra, the sun god, as he rose. (Source: the keep.org)