In chapter 40 the Pharaoh’s chief cupbearer and chief baker are thrown into prison with Joseph. They both have strange dreams and Joseph interprets the dreams for them because “interpretations belong to God” and he has access to God. The chief cupbearer is relieved to learn that he will soon be restored to his former position but the baker learns he will be executed. This is somewhat ironic as the baker only recounted his dream after he “saw that Joseph had given a favourable interpretation” to the cupbearer. Joseph had high hopes that the cupbearer would get him released from prison but it is not until two years later when Pharaoh has dreams of his own that Joseph is called for.
Joseph is called before Pharaoh and again testifies that God can provide the meaning of dreams. Joseph relates that Egypt will experience seven years of plenty followed by seven years of famine and therefore they had better prepare. He recommends that they store one fifth of the harvest during the years of plenty so that they will have enough later on. Pharaoh recognises that Joseph has the spirit of God and therefore appoints him to look after this. Joseph is renamed Zaphenath-Paneah and given a wife named Asenath who is the daughter of Potiphera, priest of On. Their relationship is detailed in the pseudepigraphal work Joseph and Asenath. It is a rather fanciful story but one that seeks to explain how a patriarch of Israel could marry a pagan, and the daughter of a pagan priest at that. Nothing more is said of Asenath in the Bible other than that she fathered two sons: Manasseh and Ephraim. This would become very important in subsequent history because the dedication of the tribe of Levi to God would create the need for another tribe to return the number to twelve when dividing the land. Joseph’s two sons fill that need (Joshua 14:4).
During the years of plenty Joseph oversaw the collection of grain “beyond measure.” Once the famine began, “all the world came to Egypt to buy grain from Joseph, because the famine was severe everywhere” (41:57). It is fortunate that he collected so much grain. Jacob and the brothers in Canaan are also short of food and when they hear that there is grain for sale in Egypt they make the trip down to buy some. When they arrive it is Joseph who is in charge of the grain sales but they do not recognise him. He accuses them of being spies and has them thrown in jail. He tells them that he will keep Simeon in jail until they return with their youngest brother. Jacob is dismayed to hear this when they return and refuses to send Benjamin down south, preferring to have him safe at home than to potentially lose him in order to get Simeon back. Poor Simeon.