Hashem spoke to Moshe, and He said to him, "I am Hashem."
The Torah tells us that Hashem spoke to Moshe, but does not tell us what Hashem said. If what he told him was ‘I am Hashem’, Hashem had already told him that in last week’s Parsha when Hashem told him זה שמי לעלם – this is my name forever.
The Ohr Hachaim explains that in the end of last week’s Parsha, Moshe spoke inappropriately to Hashem. His pain over Klal Yisroel’s fate caused him to talk to Hashem in a way that one does not speak to a great, awesome, and powerful G-d. The reason he did so was that Hashem treated him with kindness, revealing Himself to Moshe with the name of הוי"ה, which is His name of mercy. Moshe became overfamiliar with Hashem, so he did not speak as he should. Hashem then spoke to him with the name of strict judgment – א-להים, showing a face of anger and distance from him.
This is the meaning of the possuk וַיְדַבֵּר אֱלֹוקים – And Hashem spoke, using the name of judgment. With that name, Hashem told Moshe Rabbeinu that his speech was inappropriate and that he should remember that Hashem has a Middah of judgment too.
He then told him אֲנִי ה' – I am Hashem. Chazal tell us במקום גילֹה שם תהאַרעדה – at the place of happiness, we should also experience terror. Hashem was teaching him that a person should experience both attitudes at the same time. When he is scared of Hashem, he should also feel the closeness to a Loving Father, but when Hashem shows him His Loving side, a person should not lose his fear of Hashem and His Majesty.
The Ohr Hachaim offers another explanation.
Hashem spoke to Moshe with judgment, telling him that he had misspoken. He explained to him with the words אני ה' – I am Hashem.
Moshe had accused Hashem of doing bad to Klal Yisroel and mistreating them. He essentially attributed a strict judgment to Hashem. Hashem answered Moshe by saying אני ה' – I am the merciful G-d, and I would not act with strict judgment to My nation. No evil emerges from His actions, and calling his actions ‘bad’ is incorrect.
Indeed, whenever the Torah or Nevi’im mention something evil happening to Klal Yisroel, it is always considered a product of a person’s actions. One example is כ אֲשֶׁר יֹאמַר מְשָׁלוֹ הַקְדְמוֹנִי מֵּרְשָׁעִים יֵּצֵּא רֶשַע - As the proverb of the ancients says, "Out of the wicked comes forth wickedness". The evil that happens is a product of someone’s misdeeds. Another possuk says תְי סְרֵּךְ רָעָתֵּךְ - Your own wickedness shall correct you. All evil is attributed to the person committing aveiros.
When good comes to the world, it is attributed to Hashem גַם ה' יִתֵּן הַטּוב - Yes, Hashem will give that which is good.
Moshe should know that Hashem’s Middah is compassion and kindness, and anything that is wrong, bad, or painful, is the fault of the person who did aveiros and brought the powers of evil to this world. Moshe shouldn’t have turned the blame onto Hashem but back to Klal Yisroel. For example, Chazal tell us that the elders of Klal Yisroel joined Moshe when he went to Par’oh, but they slowly turned back on the way, too fearful to enter the palace of Par’oh uninvited. Moshe should have passed the blame for his failure to move Par’oh and for Par’oh’s intensifying his subjugation onto them, not Hashem.
The Ohr Hachaim has yet another explanation.
The possuk says מוצִיא אֲסִירִים בְכושָׁרות – He releases the captured in an appropriate time. The Medrash explains the word בְכושָׁרות as being a combination of two words בבכי ובשירות – with crying and song. The Medrash explains that the Mitzrim were crying, as they buried their dead from מכת בכורות, and Klal Yisroel were singing.
These two things are essentially two Midos of Hashem דין and רחמים. Hashem redeemed Klal Yisroel from Mitzrayim with מדת הדין – strict judgment – for the Mitzrim. They were punished for that which they did to Hashem’s nation. Another part of the redemption from Mitzrayim was the compassion that Hashem showed His people, and he redeemed them with מדת הרחמים.
Hashem spoke to Moshe with the Name of judgment – אלֹוקים, and He told him אני ה' – I am Hashem of מדת הרחמים. Both would combine together to redeem Klal Yisroel.
Klal Yisroel were mixed into the Mitzrim, and they were in great danger. When the Mal’ach whose job it is to destroy a society begins his work, he does not differentiate between a Tzadik and a Rasha. When Hashem decides to punish Mitzrayim for that which they did, Klal Yisroel is also in danger. How will the destructive forces focus their efforts only on the Mitzrim? How will they know to keep away from Klal Yisroel?
For this reason, a special מדת הרחמים was needed, and Klal Yisroel in these days were governed by this Middah. This saved them from the decree of the Mitzrim and allowed them to live through the Makos.
The possuk is saying that Hashem spoke to Moshe with מדת הדין, and He told him that when He acts with מדת הדין, He will invoke the מדת הרחמים to ensure that Klal Yisroel is saved from Mitzrayim.
Indeed, at some of the מכות, the Torah adds that Klal Yisroel were saved from them. A special force had to be awakened to save them from the Makkah, because מדת הדין does not differentiate. וּלְכָל בְנֵי יִשְרָאֵל הָיָה אוֹר בְמושְבֹתָם – To all of Klal Yisroel there was light in their dwelling places. Although the Mitzrim were suffering Din, Klal Yisroel had Rachamim.