"Then Pharaoh sent and called for Joseph, and they rushed him out of the dungeon." Rabbi Aba opened [the discussion] by quoting [the verse:] "G‑d desires those who fear Him, those who await His mercy". (Psalms 147:11) How much G‑d delights in the righteous, for they make peace Above, they make peace below and they bring the Bride [the Shechinah] to Her Husband [Zeir Anpin]. G‑d is therefore pleased with those who fear Him and abide by His will.

...when a man studies the Torah at night, a thread of grace is drawn upon him during the day...

"Those who eagerly await His mercy." Who are "those who await His mercy?" They are those who study the Torah at night and join the Shechinah. When morning comes, they await His mercy. It has already been explained (Avoda Zara 3b) that when a man studies the Torah at night, a thread of grace is drawn upon him during the day, as it is written: "G‑d will command His loving kindness in the daytime, and in the night His song shall be with me". (Psalms 42:9) Why is it said that "G‑d will command His loving kindness in the daytime?" Because "in the night His song [the Torah] shall be with me" [for he was studying at night].

This also explains why the verse, "G‑d desires those who fear Him," uses the particle et instead of "beit/in," as one who desires another and wishes to be reconciled with him. It is therefore written: "G‑d appeases ['ritza'] those who fear him" rather than "G‑d desires ['ratza'] those who fear Him."

Similarly, Joseph was sad in mind and spirit because he was imprisoned. Once Pharaoh sent for him, it is written: "and they rushed him out" [from the root 'ratz', also related to 'ritzui/appeasement'] that they appeased him [for imprisoning him unjustly] and addressed him with joyful words that gladden the heart because he was dejected in the pit. Come and see! First he fell into a pit, and he later rose to greatness. . [From the very thing (the pit) that oppressed him, he was elevated and healed].

Rabbi Shimon said: Before the incident [with Potifar’s wife], Joseph was not called 'Tzaddik/righteous one'. After he guarded the Holy Covenant [by running away from her attempt to seduce him], he was called Righteous and the sefira of yesod [represented in the physical realm by the sexual organ] was identified with him. That which was with him in the pit [the Shechinah which accompanies those who are troubled] arose with him. It is written: "and they rushed him out of the pit", for he ascended from the pit and was adorned with a well of living waters [i.e. the Shechinah/malchut that had been like a closed cistern without water, now filled with Joseph/yesod's flowing waters].

"Then Pharaoh sent and he called Joseph." It should have written "to call Joseph" but it was G‑d [Who called to him to come free of the pit of kelipot], as it is written, "[Joseph's soul was placed in irons] until the time that His word came to pass; the word of G‑d had purified him" [through the test with Potifar’s wife]. (Psalms 105:17-19) "until the time that His word came to pass" [refers to] "and he called Joseph". Here it is written "and called Joseph" and elsewhere "And He called to Moses". (Lev. 1:1) [In both cases, it refers to the Shechinah calling.]

Joseph is the only one referred to as HaTzadik/the righteous one.

BeRahamim LeHayyim:
The Forefathers serve as the vehicle for bringing G‑d's presence known in this world. Abraham is the vehicle for lovingkindness, Isaac is the vehicle of discipline and severity, Jacob is the vehicle of beauty and balance.

Joseph is the only one referred to as HaTzadik/the righteous one. His life mirrors the actions of the Supernal Foundation, whose role in the "downward" progression of G‑d's flow is to bring blessing and bounty to the lower world. He was severely tested [the Talmud brings 2 examples of even greater testing], and passed.

The reward was to carve him a special place in history, and in the future.

We are tested all the time. Particularly concerning the Holy Covenant. Soon we will be in the midst of the special Shovavim period [See Sefer Ben Olam HaBa--forthcoming]. It would be wise to reflect on this Zohar, and Joseph as a paradigm of proper conduct in the light of extreme temptation.

[Bracketed annotations from Metok Midevash and Sulam commentaries]