According to Wikipedia:
Although the Egyptians recognized that the pharaoh was human and subject to human weakness, they simultaneously viewed him as a god, because the divine power of kingship was incarnated in him. He therefore acted as intermediary between Egypt's people and the gods. He was key to upholding Ma'at, both by maintaining justice and harmony in human society and by sustaining the gods with temples and offerings. For these reasons, he oversaw all state religious activity. However, the pharaoh's real-life influence and prestige could differ from his portrayal in official writings and depictions, and beginning in the late New Kingdom his religious importance declined drastically.
The king was also associated with many specific deities. He was identified directly with Horus, who represented kingship itself, and he was seen as the son of Ra, who ruled and regulated nature as the pharaoh ruled and regulated society. By the New Kingdom he was also associated with Amun, the supreme force in the cosmos.Upon his death, the king became fully deified. In this state, he was directly identified with Ra, and was also associated with Osiris, god of death and rebirth and the mythological father of Horus. Many mortuary temples were dedicated to the worship of deceased pharaohs as gods.
Did any of the ancient writers writing about Egypt, mention the ancient Egyptians' belief with regard to deifying their kings?