The oldest god was the Sun god, Re, or Ra. During the Old Kingdom, kings built their pyramids to worship Re/Ra.
The early Egyptians believed that he created the world, and this is why the rizing Sun was the symbol of creation. The daily cycle of the Sun moving across the sky represented creation and renewal.
Re was seen as a mirror image of the pharaoh, one ruling the universe, the other ruling the Earth. Horus and Re were merged in the symbol of a winged Sun disk.
In the 5th Dynasty kings built pyramids in line with the rizing and setting Sun.
Inside the pyramids we find the Pyramid Texts, from which we get much information about Re. The Pyramid Texts describe the journey of the dead pharaoh through the underworld.
The story of Re says that Re rose in the beginning of creation. He then spat forth Shu and Tefnut, who became the first godly couple. They gave birth to Geb and Nut - the Earth and sky. Geb and Nut then gave birth to Osiris and Isis, and Seth and Nephthys. Osiris is murdered by his brother Seth and then made the god that rules over the dead.
Because different gods were worshipped in different parts of Egypt, when Egypt was united, it became important to unite the gods. As a result, Re, the most important god of the north, is combined with the creator god, Amun of southern Egypt into Amun-Re, or Amun-Ra.
Re is shown with the body of a human and the head of a ram. He is also connected with the scarab beetle, required to intervene in human affairs and transfers his powers to Horus, the King, thus conceding the throne to his physical son.
In the New Kingdom, pharaohs connected themselves directly with Re. Amenhotep III called himself "the dazzling Sun", and Akhenaten changed the religion to the worship of the Sun alone. Sun-based symbols include the Sun disk, the celestial barque, the double lion and the obelisk.