At first there was nothing but Nun, the primal ocean of chaos which contained the seeds of everything to come. In this jumble of waters the sun god reposed. Finally, by an exertion of will, he emerged from chaos as Ra and gave birth to Shu and Tefnut by himself. In turn Shu, the god of air, and Tefnut, the goddess of moisture, gave birth to Geb and Nut, the earth god and sky goddess. Thus the physical universe was created.
Men were created from Ra's tears. Eons passed and Ra grew decrepit, so the ungrateful race of men plotted against Ra. When Ra learned of these plots he angrily called a council of the gods. The gods decided that mankind must be destroyed, and Ra despatched the goddess Hathor to wipe out humankind. Hathor did an effective job of it, killing men by the tens of thousands until only a tiny remnant was left. Then Ra relented, and men were spared. But Ra was thoroughly sick of the world and retreated into the heavens, leaving Shu to reign in his place. At that time the present world was established.
Against the orders of Ra, Geb, the earth god, and Nut, the sky goddess, married. Then Ra in his wrath ordered Shu, the air god, to separate them. Shu defeated Geb and raised Nut aloft, separating them permanently. However, Nut was pregnant, and Ra had decreed that she could not give birth in any month of any year. Seeing her plight, the god of learning, Thoth, gambled with the moon for extra light and thus was able to add five extra days to the official Egyptian calendar of 360 days. On those five days Nut gave birth to Osiris, Horus the Elder, Set, Isis, and Nepthys, successively. Osiris became the incarnation of good, while Set became the embodiment of evil. In this manner the two poles of morality were fixed once and for all.