We do not know. The mythology surrounding Ra, the most important god to the ancient egyptians, is pretty ancient and egyptologists believe that it predates the First Dynasty of Egypt about 2900 B.C or 5000 years ago. The egyptian gods Ra, Horus and Osiris seem to already have been worshiped by egyptians long before the First Dynasty because inscriptions and old temples have been uncovered in many egyptian cities dating from this time which indicate that 'Ra-worship' was already ancient by the First Dynasty.