Another matter, “then Moses…sang” – that is what is written: “They believed in His words, they sang His praise” (Psalms 106:12). Rabbi Abahu said: Although it is written that they already believed while they were in Egypt, as it is stated: “The people believed” (Exodus 4:31), they subsequently did not believe, as it is stated: “Our ancestors in Egypt did not comprehend Your wonders” (Psalms 106:7).
When they came to the sea and saw the might of the Holy One blessed be He, how He administers justice to the wicked, as you say: “My hand grasps judgment” (Deuteronomy 32:41), and He sunk the Egyptians in the sea, immediately: “They believed in God” (Exodus 14:31). Due to that belief, the Divine Spirit rested upon them and they sang a song. That is what is written: “Then [az] Moses and the children of Israel sang.”
Az means nothing other than faith, as it is stated: “It was from when [me’az] he appointed him in his house” (Genesis 39:5), and it is written: “Everything he had he placed in his hands” (Genesis 39:4).2When Potiphar trusted Joseph fully and placed him in charge of his entire household, the verse uses the word az in stating that Potiphar appointed Joseph in his house. That is: “They believed in His words, they sang His praise.”