ויהי ה' את יוסף. מדרש לא כמדת הקב"ה מדת ב"ו מדת ב"ו כל זמן שאהובו בגדולה הוא מצוי אצלו תמיד ירד מגדולתו הוא משליכו אחר גוו. והקב"ה אינו כן כי היה עמו בגדולתו ובירידתו בבית המצרי היה עמו וכשהיה ראש ומשנה למלך גם שם היה עמו שנא' ויהי ה' את יוסף וכן בבית הסהר ויהי ה' את יוסף ויט אליו חסד. וכמו כן מדת יוסף אינו כשאר בני אדם שהרי אדם עני ירא את אלהים אבל העשיר אינו ירא אבל יוסף בבית אדונתו אמר ואיך אעשה הרעה הגדולה וגו' וכשהיה מלך אמר את האלהים אני ירא. ד"א ויהי ה' את יוסף משל לאדם שהיו לו עשרה בנים בעשר מדינות הניחם כלם והלך לו אצל הקטן לפי שהיה תש כח וצריך סיוע יותר מכולם. ועוד משל לאדם שיש לו עשרה חמורים טעונין יין ברשות הרבים נכנס אחד מהם בבית עכו"ם הניח כל חמוריו והלך אחר אותו שנכנס בבית העכו"ם כדי שלא יתנסך היין כך הקב"ה היה עם יוסף בבית המצרי כדי שלא ילמד ממעשיו: ויהי ה' את יוסף , “and the Lord was with Joseph;” the Midrash sees in this line a lesson for us to compare G–d’s method of befriending us to how human beings befriend their masters or superiors. As long as their superiors are successful and amass glory the underlings surround the king and flatter him nonstop. As soon however, as the king or master falls on hard times, his former “friends,” and flatterers abandon him as they would a ship about to sink. The reverse is true of Hashem. As soon as Joseph fell on hard times, G–d went out of His way to show him that far from having abandoned him, on the contrary, He now went out of His way to make life easier for him. He supported him when he became viceroy of Egypt for 80 years, as well as when he was still a slave in the house of Potiphar, and even when jailed for supposedly having tried to rape his wife. It is remarkable that also Joseph’s way of responding to the way the brothers had treated him were quite different from the way ordinary people would have reacted to this given the chance. Normally, poor people display some fear of G–d, as He is the only one from whom they can expect help. Joseph, even when in a position of power, repeatedly refused to do something that G–d would not approve of (Compare Genesis 42,18 as well as 39,9) An alternate interpretation of the line: ויהי ה' את יוסף. Imagine someone blessed with ten children, each one of whom lives in a different country. Instead of visiting them all in rotation, he concentrated on spending time with the youngest, as he was less well endowed than his brothers, and depended more on advice and assistance from his father. Take another parable illustrating our subject. A wine merchant had loaded ten donkeys with barrels of wine and began to lead them on the public highway. Suddenly one donkey veered and entered the house of a pagan. Right away the owner abandoned all the other nine donkeys out of concern that a pagan might touch the wine on the back of the last mentioned animal and make it unfit for Jews to drink from. Similarly, as soon as G–d saw that Joseph had been brought to the house of an Egyptian who was now his master, He hurried to supervise his fate to protect him from harm. He was afraid that unless He did so, Joseph might learn to copy the lifestyle of his master.