Old Kingdom theology fused kingship with the solar cult of Ra, whose priesthood at Heliopolis grew immensely wealthy and influential as successive kings styled themselves Son of Ra and built solar temples alongside their pyramids, particularly under the Fifth Dynasty. The king was also identified with Horus while alive and with Osiris, god of the dead, once buried, a double identity that structured Egyptian kingship for the rest of pharaonic history. The pyramid itself was conceived as a mechanism for the king's ascent to join the imperishable circumpolar stars and to sail with Ra across the sky, an afterlife reserved for royalty alone in this period.
That theology survives in the Pyramid Texts, first carved into the burial chamber walls of King Unas at the close of the Fifth Dynasty and continued under his Sixth Dynasty successors, making them the oldest substantial body of religious writing preserved anywhere in the world. The texts are a loose collection of spells, hymns and ritual utterances meant to protect the king's body, feed his spirit and guide him past hostile beings on the journey into the sky, rather than a single composed scripture. Raymond Faulkner's translation remains the standard English edition. Access to this afterlife literature broadened only after the Old Kingdom's collapse, when Middle Kingdom officials adapted the same spells, now called the Coffin Texts, for their own burials, a democratization that later Egyptologists have read as one consequence of the weakening of royal authority the Old Kingdom's own history had already set in motion.