On his arrival in Egypt, Joseph was sold to Potiphar, an officer of the ruling Pharaoh, and diligently worked his way into a position as a most-trusted servant. Unfortunately for Joseph, he resisted the sexual advances of his master's wife, and as revenge, she told Potiphar that he had taken her. Joseph spent many years in an Egyptian prison. Even in his teenage years, and probably as a gift from his Heavenly Father, Joseph was a skilled interpreter of dreams. This valuable talent was eventually brought to the attention of the Pharaoh, who was haunted by a recurring dream of his own which none of his dream-interpreters could adequately explain. Joseph interpreted the dream as a prophecy that Egypt would have seven years of plenty followed by seven years of famine. The Pharaoh was so impressed with Joseph's interpretation of his dreams that Joseph not only avoided a return to prison, but was made the commissioner of supplies. By the time the famine struck, Joseph was the second most powerful person in Egypt.
Excerpt from Chapter 54 of The Soul of Jesus.