2 years later, the Pharaoh had some dreams...7 fat cows being eaten by 7 skinny cows, etc. And no one could interpret the dreams for him, aww. Then the royal cupbearer was like, "OMG! I totally left Joseph rotting in jail!" So he told the Pharaoh about Joseph's awesome dream-interpreting skills, and so the Pharaoh sent for Joseph. And of course, Joseph is able to interpret the dreams...they mean that Egypt will have 7 years of abundance followed by 7 years of famine.
Then Joseph cleverly suggests that the Pharaoh finds a "discerning and wise man" to collect some extra food and store it for the famine. The Pharaoh says (paraphrase), "well, you were wise enough to interpret my dreams, you do it!" Uh...this Pharaoh must have been an idiot. So Joseph becomes the Pharaoh's #2.
The Pharaoh gives him robes of fine linen, a gold chain, a fancy new name (Zaphenath-Paneah, which doesn't seem to ever be used again...I guess 'Joseph' is more memorable), and a wife! Things are going swimmingly for Joseph; he has 2 sons, and "men shouted before him, 'Make way!'" He travels all over Egypt and takes food and stores it in the cities, so much food that "he stopped keeping records because it was beyond measure."
However, the bible also said that Joseph stored 1/5 of all that was produced, which doesn't sound "beyond measure" to me. It sounds like "not enough." I mean, if you assume that the rate of consumption is the same, wouldn't you have to save 1/2 of everything for 7 years to survive a 7 year famine?
So the years of abundance are over, and the famine begins... it's happening in Egypt and all the other countries in the area. The people of Egypt start asking for food, and the Pharaoh sends them to Joseph. Joseph opens up the storehouses and "sold grain to the Egyptians." Sold grain to the Egyptians??? Joseph is selling these own people's food back to them! That's just wrong. That would be like if the government took money from the people and gave it to banks, just so the banks could lend it to the people at increased interest rates...oh wait.
Joseph also sold food to other countries. Apparently, Joseph didn't bother to tell anyone else that a famine was coming. That's nice. Also, I do not understand how there is even enough food for the Egyptians, let alone everyone else.