(ו) עֲשָׂרָה דְבָרִים נִבְרְאוּ בְעֶרֶב שַׁבָּת בֵּין הַשְּׁמָשׁוֹת, וְאֵלּו הֵן, פִּי הָאָרֶץ, וּפִי הַבְּאֵר, וּפִי הָאָתוֹן, וְהַקֶּשֶׁת, וְהַמָּן, וְהַמַּטֶּה, וְהַשָּׁמִיר, וְהַכְּתָב, וְהַמִּכְתָּב, וְהַלּוּחוֹת. וְיֵשׁ אוֹמְרִים, אַף הַמַּזִּיקִין, וקְבוּרָתוֹ שֶׁל משֶׁה, וְאֵילוֹ שֶׁל אַבְרָהָם אָבִינוּ. וְיֵשׁ אוֹמְרִים, אַף צְבָת בִצְבָת עֲשׂוּיָה:
(6) Ten things were created on the eve of the [first] Sabbath at twilight, And these are they: [1] The mouth of the earth [that swallowed Korach in Numbers 16:32], [2] The mouth of the well [that accompanied the Israelites in the Wilderness in Numbers 21:17], [3] The mouth of the donkey [that spoke to Balaam in Numbers 22:28–30], [4] The rainbow [that served as a covenant after the Flood in Genesis 9:13], [5] The manna [that God provided the Israelites in the Wilderness in Exodus 16:4–21], [6] The rod [of Moses], [7] The shamir [worm that helped build the Temple without metal tools], [8] the letters, [9] the writing, and [10] the tablets [of the Ten Commandments]. ... And some say: Also tongs made with tongs.
(1) There were three features possessed by the prophecy of Balaam that were absent from that of Moses: 1) Moses did not know who was speaking with him, whereas Balaam knew who was speaking with him; 2) Moses did not know when the Holy One of Blessing would speak with him, whereas Balaam knew...3) Balaam spoke with God whenever he pleased...Moses, however, did not speak with God whenever he wished.
Bamidbar Rabbah 14:1
That which happened to Balaam on the way, and the speaking of the ass, took place in a prophetic vision, since further on, in the same account, an angel of God is introduced as speaking to Balaam.
Maimonides, Guide for the Perplexed, 2:42
Ibid., 2:45
