In about 2375 B.C. a pyramid was built for the pharaoh Unas at Saqqara. This was one of the first pyramids to be decorated inside. It was decorated with a group of spells for getting through the underworld known as the 'pyramid texts'. Some of the spells from the Book of the Dead can be traced back to these 'pyramid texts'.
For more about the journey through the underworld, see the Challenge in the Mummification chapter.