Sefer Maginisa D’Bei Rabbanan relates the following story:
Rav Avrohom Yaakov of Sadiger zy”a was once libeled by non-Jews and accused of a crime. He was arrested on Shabbos and taken to jail. At that time, he quoted the pasuk (Tehillim 73:1): “Only good to Yisroel is Elokim, to the pure of heart.” Rav Boruch of Mezhibozh zy”a explains that Klal Yisroel always experiences only good. If one were to say “Elokim” – meaning if one were to ask: Why are we being treated with the middas hadin? “To the pure of heart” – those who are pure of heart take this judgment off of the nation and onto themselves.
Rav Avrohom Yaakov used this concept that tzadikim accept the middas hadin upon themselves to explain the first pasuk in this week’s Parshah: “And Elokim spoke.” Hashem spoke with the middas hadin. “To Moshe” – to the tzadik, who takes middas hadin upon himself. “And He said to him, I am Havaya” – He said that when a tzadik accepts the judgement onto himself, Hashem switches to middas harachamim for the rest of Klal Yisroel.
