The Bilaam Narrative: Biblical & Rabbinic Sources of the Medieval Commentators
Rembrandt, Balaam and the Ass, 1626 (public domain image)
Parashat Balak in Sefer Bemidbar tells the story of Balak, king of Moav, who hires the prophet Bilaam to curse Bnei Yisrael as they approach his territory east of the Jordan River. Bilaam is regarded as an effective prophet but consistently fails to curse Bnei Yisrael, blessing them instead. He is also famous for the incident of the talking donkey, who recognizes an angel blocking their path before Bilaam, the supposedly great seer, does.
The strangeness of the story, told in Bemidbar 22-24, including the fact that we utter Bilaam's unintended blessing as part of our regular liturgy, led to much midrashic and other rabbinic speculation. In addition, Bilaam appear intratextually within Tanakh, which the medieval mefarshim (commentators) take as a starting point for their examination of the Bilaam narrative.
[Note: The sources on this sheet include discussion of explicit sexuality and are not appropriate for all audiences.]

Discussion of Bilaam in the Tanakh

The parashah that follows Balak, Parashas Pinchas, describes an incident at Baal Peor in which Bnei Yisrael engage in sexual improriety; it is intertwined in the minds of rabbinic and medieval commentators (see also Tanhuma, Balak 17a).
They note, for instance, that Bilaam is killed after Baal Peor by the sword, which they understand to be an allusion to his involvement in the incident.
(ח) וְאֶת־מַלְכֵ֨י מִדְיָ֜ן הָרְג֣וּ עַל־חַלְלֵיהֶ֗ם אֶת־אֱוִ֤י וְאֶת־רֶ֙קֶם֙ וְאֶת־צ֤וּר וְאֶת־חוּר֙ וְאֶת־רֶ֔בַע חֲמֵ֖שֶׁת מַלְכֵ֣י מִדְיָ֑ן וְאֵת֙ בִּלְעָ֣ם בֶּן־בְּע֔וֹר הָרְג֖וּ בֶּחָֽרֶב׃
(8) Along with their other victims, they slew the kings of Midian: Evi, Rekem, Zur, Hur, and Reba, the five kings of Midian. They also put Balaam son of Beor to the sword.
Several verses later, Moshe gives one of the harshest commands of his term as leader. He says that a plague has broken out in the camp due to the sin at Baal Peor and that all its participants must be put to death. In so commanding, Moshe explicitly blames Bilaam for his role in Baal Peor:
(יד) וַיִּקְצֹ֣ף מֹשֶׁ֔ה עַ֖ל פְּקוּדֵ֣י הֶחָ֑יִל שָׂרֵ֤י הָאֲלָפִים֙ וְשָׂרֵ֣י הַמֵּא֔וֹת הַבָּאִ֖ים מִצְּבָ֥א הַמִּלְחָמָֽה׃ (טו) וַיֹּ֥אמֶר אֲלֵיהֶ֖ם מֹשֶׁ֑ה הַֽחִיִּיתֶ֖ם כָּל־נְקֵבָֽה׃ (טז) הֵ֣ן הֵ֜נָּה הָי֨וּ לִבְנֵ֤י יִשְׂרָאֵל֙ בִּדְבַ֣ר בִּלְעָ֔ם לִמְסָר־מַ֥עַל בַּה' עַל־דְּבַר־פְּע֑וֹר וַתְּהִ֥י הַמַּגֵּפָ֖ה בַּעֲדַ֥ת ה' (יז) וְעַתָּ֕ה הִרְג֥וּ כָל־זָכָ֖ר בַּטָּ֑ף וְכָל־אִשָּׁ֗ה יֹדַ֥עַת אִ֛ישׁ לְמִשְׁכַּ֥ב זָכָ֖ר הֲרֹֽגוּ׃ (יח) וְכֹל֙ הַטַּ֣ף בַּנָּשִׁ֔ים אֲשֶׁ֥ר לֹא־יָדְע֖וּ מִשְׁכַּ֣ב זָכָ֑ר הַחֲי֖וּ לָכֶֽם׃
(14) Moses became angry with the commanders of the army, the officers of thousands and the officers of hundreds, who had come back from the military campaign. (15) Moses said to them, “You have spared every female! (16) Yet they are the very ones who, at the bidding of Balaam, induced the Israelites to trespass against the LORD in the matter of Peor, so that the LORD’s community was struck by the plague. (17) Now, therefore, slay every male among the children, and slay also every woman who has known a man carnally; (18) but spare every young woman who has not had carnal relations with a man.
The story of Bilaam is briefly retold in Sefer Yehoshua:
(ט) וַיָּ֨קָם בָּלָ֤ק בֶּן־צִפּוֹר֙ מֶ֣לֶךְ מוֹאָ֔ב וַיִּלָּ֖חֶם בְּיִשְׂרָאֵ֑ל וַיִּשְׁלַ֗ח וַיִּקְרָ֛א לְבִלְעָ֥ם בֶּן־בְּע֖וֹר לְקַלֵּ֥ל אֶתְכֶֽם׃ (י) וְלֹ֥א אָבִ֖יתִי לִשְׁמֹ֣עַ לְבִלְעָ֑ם וַיְבָ֤רֶךְ בָּרוֹךְ֙ אֶתְכֶ֔ם וָאַצִּ֥ל אֶתְכֶ֖ם מִיָּדֽוֹ׃
(9) Thereupon Balak son of Zippor, the king of Moab, made ready to attack Israel. He sent for Balaam son of Beor to curse you, (10) but I refused to listen to Balaam; he had to bless you, and thus I saved you from him.
Bilaam is also alluded to in the book of Micah:
(ה) עַמִּ֗י זְכָר־נָא֙ מַה־יָּעַ֗ץ בָּלָק֙ מֶ֣לֶךְ מוֹאָ֔ב וּמֶה־עָנָ֥ה אֹת֖וֹ בִּלְעָ֣ם בֶּן־בְּע֑וֹר מִן־הַשִּׁטִּים֙ עַד־הַגִּלְגָּ֔ל לְמַ֕עַן דַּ֖עַת צִדְק֥וֹת ה׳
(5) “My people, Remember what Balak king of Moab Plotted against you, And how Balaam son of Beor Responded to him. [Recall your passage] From Shittim to Gilgal— And you will recognize The gracious acts of Adonai.”

Bilaam in the Mishnah & Talmud

Pirkei Avot has an important midrashic passage regarding the ten miracles pre-programmed into earthly existence, in the twilight period (bein ha-shemashot) of the very first erev Shabbat. One of these is Bilaam's talking donkey:
(ו) עֲשָׂרָה דְבָרִים נִבְרְאוּ בְּעֶרֶב שַׁבָּת בֵּין הַשְּׁמָשׁוֹת, וְאֵלּוּ הֵן, פִּי הָאָרֶץ, וּפִי הַבְּאֵר, וּפִי הָאָתוֹן, וְהַקֶּשֶׁת, וְהַמָּן, וְהַמַּטֶּה, וְהַשָּׁמִיר, וְהַכְּתָב, וְהַמִּכְתָּב, וְהַלּוּחוֹת. וְיֵשׁ אוֹמְרִים, אַף הַמַּזִּיקִין, וּקְבוּרָתוֹ שֶׁל משֶׁה, וְאֵילוֹ שֶׁל אַבְרָהָם אָבִינוּ. וְיֵשׁ אוֹמְרִים, אַף צְבָת בִּצְבָת עֲשׂוּיָה:
(6) Ten things were created on the eve of the [first] Shabbat at twilight. And these are they: The mouth of the earth [that swallowed Korach in Numbers 16:32]; and the mouth of the well [that accompanied the Israelites in the wilderness in Numbers 21:17]; and the mouth of the donkey [that spoke to Bilaam in Numbers 22:28–30]; and the rainbow [that served as a covenant after the flood in Genesis 9:13]; and the manna [that God provided the Israelites in the wilderness in Exodus 16:4–21]; and the staff [of Moshe]; and the shamir (the worm that helped build the Temple without metal tools); and the letters; and the writing; and the tablets [all of the latter three, of the Ten Commandments]. And some say, also the destructive spirits, and the burial place of Moshe, our teacher, and the ram of Abraham, our father. And some say, also the [first human-made] tongs, made with [Divine] tongs.
This passage attempts to account for the fantastical nature of a talking donkey by accounting it one of ten supernatural miracles that were deliberately crafted into creation.
Another passage from Pirkei Avot characterizes the students of Bilaam "the wicked" negatively, stating that their lot is in Gehinnom:
(יט) כָּל מִי שֶׁיֵּשׁ בְּיָדוֹ שְׁלשָׁה דְבָרִים הַלָּלוּ, מִתַּלְמִידָיו שֶׁל אַבְרָהָם אָבִינוּ. וּשְׁלשָׁה דְבָרִים אֲחֵרִים, מִתַּלְמִידָיו שֶׁל בִּלְעָם הָרָשָׁע. עַיִן טוֹבָה, וְרוּחַ נְמוּכָה, וְנֶפֶשׁ שְׁפָלָה, מִתַּלְמִידָיו שֶׁל אַבְרָהָם אָבִינוּ. עַיִן רָעָה, וְרוּחַ גְּבוֹהָה, וְנֶפֶשׁ רְחָבָה, מִתַּלְמִידָיו שֶׁל בִּלְעָם הָרָשָׁע. מַה בֵּין תַּלְמִידָיו שֶׁל אַבְרָהָם אָבִינוּ לְתַלְמִידָיו שֶׁל בִּלְעָם הָרָשָׁע. תַּלְמִידָיו שֶׁל אַבְרָהָם אָבִינוּ, אוֹכְלִין בָּעוֹלָם הַזֶּה וְנוֹחֲלִין בָּעוֹלָם הַבָּא, שֶׁנֶּאֱמַר (משלי ח) לְהַנְחִיל אֹהֲבַי יֵשׁ, וְאֹצְרֹתֵיהֶם אֲמַלֵּא. אֲבָל תַּלְמִידָיו שֶׁל בִּלְעָם הָרָשָׁע יוֹרְשִׁין גֵּיהִנֹּם וְיוֹרְדִין לִבְאֵר שַׁחַת, שֶׁנֶּאֱמַר (תהלים נה) וְאַתָּה אֱלֹקִים תּוֹרִידֵם לִבְאֵר שַׁחַת, אַנְשֵׁי דָמִים וּמִרְמָה לֹא יֶחֱצוּ יְמֵיהֶם, וַאֲנִי אֶבְטַח בָּךְ:
(19) Anyone who has these three things is from the students of Abraham, our father, and [anyone who has] three other things is from the students of Bilaam the evildoer: [one who has] a good eye, a humble spirit and a small appetite -- is from the students of Abraham, our father. [One who has] an evil eye, a haughty spirit and a broad appetite - is from the students of Bilaam the evildoer. What [difference] is there between the students of Abraham, our father, and the students of Bilaam the evildoer? The students of Abraham, our father, eat in this world and possess the next world, as it is stated (Proverbs 8:21), "There is what for those that love Me to inherit, and their treasuries will I fill." But the students of Bilaam the evildoer inherit Gehinnom (Purgatory) and go down to the pit of destruction, as it is stated (Psalms 55:24), "And You, God, will bring them down to the pit of destruction; the people of blood and deceit, they will not live out half their days; and I will trust in You."
Interestingly, the important braita on Bava Batra 14b which deals with the authorship of the various books of Tanakh makes a point of stating that Moshe wrote the Bilaam narrative:
ומי כתבן משה כתב ספרו ופרשת בלעם ואיוב יהושע כתב ספרו ושמונה פסוקים שבתורה שמואל כתב ספרו ושופטים ורות דוד כתב ספר תהלים על ידי עשרה זקנים ע"י אדם הראשון על ידי מלכי צדק ועל ידי אברהם וע"י משה ועל ידי הימן וע"י ידותון ועל ידי אסף
The baraita now considers the authors of the biblical books: And who wrote the books of the Bible? Moses wrote his own book, i.e., the Torah, and the portion of Balaam in the Torah, and the book of Job. Joshua wrote his own book and eight verses in the Torah, which describe the death of Moses. Samuel wrote his own book, the book of Judges, and the book of Ruth. David wrote the book of Psalms by means of ten elders of previous generations, assembling a collection that included compositions of others along with his own. He included psalms authored by Adam the first man, by Melchizedek king of Salem, and by Abraham, and by Moses, and by Heman, and by Jeduthun, and by Asaph,
It may be objected that it is obvious that Moshe wrote Parashat Balak, since it is a part of the Torah. By the very fact that the braita singles out the Bilaam narrative, however, it recognizes the tensions in this strange passage, such as its vantage point of the story (to which Moshe is not privy) and also Bilaam's surprisingly strong and very real prophetic ability:
וכמה זעמו רגע וכמה רגע אחד מחמשת רבוא ושמונת אלפים ושמנה מאות ושמנים ושמנה בשעה וזו היא רגע ואין כל בריה יכולה לכוין אותה שעה חוץ מבלעם הרשע דכתיב ביה ויודע דעת עליון
...
השתא דעת בהמתו לא הוה ידע דעת עליון הוה ידע
...
אלא מלמד שהיה יודע לכוין אותה שעה שהקדוש ברוך הוא כועס בה
...
והיינו דאמר להו נביא לישראל עמי זכר נא מה יעץ בלק מלך מואב וגו׳ מאי למען דעת צדקות ה׳
How much time does His anger last? God’s anger lasts a moment. And how long is a moment? One fifty-eight thousand, eight hundred and eighty-eighth of an hour, that is a moment. The Gemara adds: And no creature can precisely determine that moment when God becomes angry, except for Balaam the wicked, about whom it is written: “He who knows the knowledge of the Most High” (Numbers 24:16).
...
This should not be understood to mean that Balaam was a full-fledged prophet. Now, clearly, Balaam did not know the mind of his animal; and he did know the mind of the Most High? If he could not understand the rebuke of his donkey, he was certainly unable to understand the mind of the Most High.
...
Rather, this verse from Numbers teaches that Balaam was able to precisely determine the hour that the Holy One, Blessed be He, is angry. At that moment, Balaam would utter his curse and, through God’s anger, it would be fulfilled.
...
And that is what the prophet said to Israel: “My nation, remember what Balak king of Moab advised, and how Balaam, son of Beor, responded; from Shittim to Gilgal, so that you may know the righteous acts of the Lord” (Micah 6:5). What is meant by the statement: “So that you may know the righteous acts of the Lord”?
Rabbinic thought levels severe judgement against Bilaam as utterly evil:
ארבעה הדיוטות בלעם ודואג ואחיתופל וגחזי: בלעם בלא עם דבר אחר בלעם שבלה עם בן בעור שבא על בעיר
§ The mishna teaches that four prominent commoners, Balaam, Doeg, Ahithophel, and Gehazi, have no share in the World-to-Come. The Gemara elaborates: The name Balaam is interpreted as a contraction of: Without a nation [belo am], or one who has no share in the World-to-Come with the Jewish nation. Alternatively, the name Balaam is interpreted as one who wore down the Jewish people [bila am]. He is the son of Beor, one who engaged in bestiality [be’ir].
(Parallel in Bereshit Rabbah 20:5; Bamidbar Rabbah 22:7)
מר זוטרא אמר קוסם באמתו היה מר בריה דרבינא אמר שבא על אתונו מ"ד קוסם באמתו היה כדאמרן ומ"ד בא על אתונו היה כתיב הכא (במדבר כד, ט) כרע שכב וכתיב התם (שופטים ה, כז) בין רגליה כרע נפל שכב וגו' (במדבר כד, טז) ויודע דעת עליון השתא דעת בהמתו לא הוה ידע דעת עליון הוה ידע מאי דעת בהמתו דאמרי ליה מאי טעמא לא רכבת סוסיא אמר להו שדאי להו ברטיבא אמרה ליה הלא אנכי אתונך לטעינא בעלמא אשר רכבת עלי אקראי בעלמא מעודך עד היום הזה ולא עוד אלא שאני עושה [לך] מעשה אישות בלילה כתיב הכא (במדבר כב, ל) ההסכן הסכנתי וכתיב התם (מלכים א א, ב) ותהי לו סוכנת אלא מאי ויודע דעת עליון
Mar Zutra says: Balaam was a diviner by using his penis. Mar, son of Ravina, says: He engaged in bestiality with his donkey. The one who says that he was a diviner by using his penis derives it as we stated. And the one who says that he engaged in bestiality with his donkey derives it as follows: It is written here: “He crouched, he lay down” (Numbers 24:9), and it is written there: “Between her legs he sunk, he fell, he lay” (Judges 5:27), which is interpreted as a reference to sexual intercourse between Sisera and Jael. § Balaam describes himself: “And he knows the knowledge of the Most High” (Numbers 24:16), and the Gemara asks: Now, if the knowledge of his animal he did not know, is it possible that the knowledge of the Most High he knew? The Gemara explains: What is the meaning of the knowledge of his animal? The princes accompanying him said to him: What is the reason that you did not ride horses? Balaam said to them: I brought the horses to graze in the pasture and rest there. The donkey said to him: “Am I not your donkey” (Numbers 22:30)? Balaam said to the donkey: Merely for burdens, not for riding. The donkey said to him: “Upon which you have ridden” (Numbers 22:30). Balaam said to the donkey: That was mere happenstance and is not a regular occurrence. The donkey said to him: “Your whole life until this day” (Numbers 22:30). The donkey continued: Moreover, I perform a conjugal act for you and we engage in bestiality at night. From where is this derived? It is written here: “Was I ever wont [hahasken hiskanti] to do so to you” (Numbers 22:30)? And it is written there with regard to Abishag the Shunammite: “And let her be a companion [sokhenet] to him” (I Kings 1:2). Just as the root samekh, kaf, nun indicates sexual relations in the case of Abishag, the same is true with regard to the donkey. Balaam was unable to best his donkey in a debate. The Gemara asks: Rather, what, then, is the meaning of the phrase “And he knows knowledge of the Most High”?
In one of the colorful necromancy stories told about Onkelos, he raises Bilaam from the dead, where he remains obstinate in his hatred for the Jewish people despite a decidedly unpleasant fate:
אזל אסקיה לבלעם בנגידא אמר ליה מאן חשיב בההוא עלמא אמר ליה ישראל מהו לאידבוקי בהו אמר ליה לא תדרוש שלומם וטובתם כל הימים אמר ליה דיניה דההוא גברא במאי אמר ליה בשכבת זרע רותחת
Onkelos then went and raised Balaam from the grave through necromancy. He said to him: Who is most important in that world where you are now? Balaam said to him: The Jewish people. Onkelos asked him: Should I then attach myself to them here in this world? Balaam said to him: You shall not seek their peace or their welfare all the days (see Deuteronomy 23:7). Onkelos said to him: What is the punishment of that man, a euphemism for Balaam himself, in the next world? Balaam said to him: He is cooked in boiling semen, as he caused Israel to engage in licentious behavior with the daughters of Moab.
Rabbinic thought also reads Bilaam into the Exodus narrative, casting him as one of the evil advisors of Paroh:
אמר רבי חייא בר אבא אמר רבי סימאי שלשה היו באותה עצה בלעם ואיוב ויתרו
...
בלעם שיעץ נהרג איוב ששתק נידון ביסורין
Rabbi Ḥiyya bar Abba says that Rabbi Simai says: Three noteworthy people were consulted by Pharaoh in that counsel where Pharaoh questioned what should be done with the Jewish people. They were Balaam, and Job, and Yitro.
...
Rabbi Ḥiyya bar Abba teaches what occurred to each of them: Balaam, who advised Pharaoh to kill all sons born to the Jewish people, was punished by being killed in the war with Midian (see Numbers 31:8).
(Parallel in Shemot Rabbah 1:9)
Finally, Chazal seek to understand what it was that prompted Bilaam to utter his blessing:
גמ׳ מנהני מילי א"ר יוחנן דאמר קרא (במדבר כד, ב) וישא בלעם את עיניו וירא את ישראל שוכן לשבטיו מה ראה ראה שאין פתחי אהליהם מכוונין זה לזה אמר ראוין הללו שתשרה עליהם שכינה:
GEMARA: The Gemara asks: From where are these matters, i.e., that one may not open an en-trance opposite another entrance, or a window opposite another window, derived? Rabbi Yoḥanan says that the verse states: “And Balaam lifted up his eyes, and he saw Israel dwelling tribe by tribe; and the spirit of God came upon him” (Numbers 24:2). The Gemara explains: What was it that Balaam saw that so inspired him? He saw that the entrances of their tents were not aligned with each other, ensuring that each family enjoyed a measure of privacy. And he said: If this is the case, these people are worthy of having the Divine Presence rest on them.

Bilaam in Midrash: On Bilaam's Power

In contradistinction to the passages above that villify Bilaam, Sifrei surprisingly acknowledges the immensity of his prophetic powers:
(מ) ולא קם נביא בישראל כמשה - אבל באומות קם. ואיזה? זה בלעם בן בעור! אלא יש הפרש בין נבואתו של משה לנבואתו של בלעם: משה לא היה יודע מי מדבר עמו, ובלעם היה יודע מי מדבר עמו, שנא' נאם שומע אמרי אל ויודע דעת עליון; משה לא היה יודע מי מדבר עמו עד שנדבר עמו, ובלעם היה יודע אימתי היה מדבר שנא' ויודע דעת עליון; משה לא היה מדבר עמו עד שהוא עומד, שנ' ואתה פה עמוד עמדי, ובלעם היה מדב' עמו כשהוא נופל, שנ' מחזה שדי יחזה נופל וגלוי עינים.
(40) (Devarim, Ibid. 10) "And there shall not arise in Israel again a prophet such as Moses": But among the nations, there did arise. And who was he? Bilam the son of Beor. But there is a difference between the prophecy of Moses and the prophecy of Bilam. Moses did not know who was speaking to him, and Bilam did know, viz. (Bamidbar 24:16) "The speech of the hearer (Bilam) of the words of the Almighty." Moses did not know when He would speak to him until He did so. Bilam did know, viz. "and the knower of the knowledge of the Most High." Moses did not speak with Him unless he was standing, viz. (Devarim 5:28) "And you, here, stand with Me." And Bilam spoke with Him when he was fallen, viz. (Bamidbar 24:4) "The vision of the Almighty shall he see, fallen and his eyes uncovered."
However, in Vayikra Rabbah Bilaam's powers are diminished:
כך אין הקדוש ברוך הוא נגלה על אומות העולם, אלא בלילה, שנאמר (בראשית כ): ויבא אלקים אל אבימלך בחלום הלילה. (שם לא): ויבא אלקים אל לבן הארמי בחלום הלילה. (במדבר כב): ויבא אלקים אל בלעם לילה. אבל נביאי ישראל ביום, שנאמר (בראשית יח): והוא יושב פתח האהל כחום היום. (שמות ו): ויהי ביום דבר ה׳ אל משה. (במדבר ג): ואלה תולדות אהרן ומשה ביום דבר ה׳ את משה וגו':
Bereshit Rabbah also acknowledges Bilaam's powers:
אמר רבי אבא בר כהנא: לא עמדו פילוסופין בעולם כבלעם בן בעור וכאבנימוס הגרדי. נתכנסו כל עובדי כוכבים אצלו. אמרו לו: תאמר שאנו יכולים ליזדווג לאומה זו? אמר: לכו וחזרו על בתי כנסיות ועל בתי מדרשות שלהן, ואם מצאתם שם תינוקות מצפצפין בקולן, אין אתם יכולים להזדווג להם, שכך הבטיחן אביהן ואמר להם:
The powers and limitations of Bilaam's prophecy are discussed at length in Bemidbar Rabbah:
(כ) וּבְבֹא משֶׁה אֶל אֹהֶל מוֹעֵד לְדַבֵּר אִתּוֹ (במדבר ז, פט), תָּנֵי (דברים לד, י): וְלֹא קָם נָבִיא עוֹד בְּיִשְׂרָאֵל כְּמשֶׁה, בְּיִשְׂרָאֵל לֹא קָם אֲבָל בְּאֻמּוֹת הָעוֹלָם קָם, כְּדֵי שֶׁלֹא יְהֵא פִּתְחוֹן פֶּה לְאֻמּוֹת הָעוֹלָם לוֹמַר אִלּוּ הָיָה לָנוּ נָבִיא כְּמשֶׁה הָיִינוּ עוֹבְדִים לְהַקָּדוֹשׁ בָּרוּךְ הוּא. וְאֵיזֶה נָבִיא הָיָה לָהֶם כְּמשֶׁה זֶה בִּלְעָם בֶּן בְּעוֹר, אֶלָּא הֶפְרֵשׁ בֵּין נְבוּאָתוֹ שֶׁל משֶׁה לִנְבוּאָתוֹ שֶׁל בִּלְעָם, שָׁלשׁ מִדּוֹת הָיוּ בְּיַד משֶׁה מַה שֶׁלֹא הָיוּ בְּיַד בִּלְעָם. משֶׁה הָיָה מְדַבֵּר עִמּוֹ עוֹמֵד, שֶׁנֶּאֱמַר (דברים ה, כח): וְאַתָּה פֹּה עֲמֹד עִמָּדִי וַאֲדַבְּרָה אֵלֶיךָ וגו', וְעִם בִּלְעָם לֹא הָיָה מְדַבֵּר עִמּוֹ אֶלָּא נוֹפֵל, שֶׁנֶּאֱמַר (במדבר כד, ד): נֹפֵל וּגְלוּי עֵינָיִם. משֶׁה הָיָה מְדַבֵּר עִמּוֹ פֶּה אֶל פֶּה, שֶׁנֶּאֱמַר (במדבר יב, ח): פֶּה אֶל פֶּה אֲדַבֵּר בּוֹ, וּבְבִלְעָם (במדבר כד, ד): נְאֻם שֹׁמֵעַ אִמְרֵי אֵל, שֶׁלֹא הָיָה מְדַבֵּר עִמּוֹ פֶּה אֶל פֶּה. משֶׁה הָיָה מְדַבֵּר עִמּוֹ פָּנִים בְּפָנִים, שֶׁנֶּאֱמַר (שמות לג, יא): וְדִבֶּר ה׳ אֶל משֶׁה פָּנִים אֶל פָּנִים, וְעִם בִּלְעָם לֹא הָיָה מְדַבֵּר כִּי אִם בִּמְשָׁלִים, כְּמָה דְתֵימָא (במדבר כג, ז): וַיִּשָֹּׂא מְשָׁלוֹ וַיֹּאמַר וגו'. שָׁלשׁ מִדּוֹת הָיוּ בְּיַד בִּלְעָם מַה שֶׁלֹא הָיוּ בְּיַד משֶׁה, משֶׁה לֹא הָיָה יוֹדֵעַ מִי מְדַבֵּר עִמּוֹ, בִּלְעָם הָיָה יוֹדֵעַ מִי מְדַבֵּר עִמּוֹ, שֶׁנֶּאֱמַר: נְאֻם שֹׁמֵעַ אִמְרֵי אֵל אֲשֶׁר מַחֲזֵה שַׁדַּי יֶחֱזֶה. משֶׁה לֹא הָיָה יוֹדֵעַ אֵימָתַי הַקָּדוֹשׁ בָּרוּךְ הוּא מְדַבֵּר עִמּוֹ, וּבִלְעָם הָיָה יוֹדֵעַ אֵימָתַי הַקָּדוֹשׁ בָּרוּךְ הוּא מְדַבֵּר עִמּוֹ, שֶׁנֶּאֱמַר (במדבר כד, טז): וְיֹדֵעַ דַּעַת עֶלְיוֹן. מָשְׁלוּ מָשָׁל לְטַבָּחוֹ שֶׁל מֶלֶךְ שֶׁהוּא יוֹדֵעַ מָה הַמֶּלֶךְ מַקְרִיב עַל שֻׁלְחָנוֹ וְיוֹדֵעַ כַּמָּה הוֹצָאוֹת יוֹצְאוֹת לַמֶּלֶךְ עַל שֻׁלְּחָנוֹ, כָּךְ הָיָה בִּלְעָם יוֹדֵעַ מָה הַקָּדוֹשׁ בָּרוּךְ הוּא עָתִיד לְדַבֵּר עִמּוֹ. בִּלְעָם הָיָה מְדַבֵּר עִמּוֹ בְּכָל שָׁעָה שֶׁיִּרְצֶה, שֶׁנֶּאֱמַר: נֹפֵל וּגְלוּי עֵינָיִם, הָיָה מִשְׁתַּטֵּחַ עַל פָּנָיו וּמִיָד הָיָה גְּלוּי עֵינָיִם עַל מַה שֶּׁשּׁוֹאֵל, וּמשֶׁה לֹא הָיָה מְדַבֵּר עִמּוֹ בְּכָל שָׁעָה שֶׁיִּרְצֶה. רַבִּי שִׁמְעוֹן אוֹמֵר אַף משֶׁה הָיָה מְדַבֵּר עִמּוֹ בְּכָל שָׁעָה שֶׁיִּרְצֶה, שֶׁנֶּאֱמַר: וּבְבֹא משֶׁה אֶל אֹהֶל מוֹעֵד לְדַבֵּר אִתּוֹ, מִיָּד (במדבר ז, פט): וַיִּשְׁמַע אֶת הַקּוֹל מִדַּבֵּר אֵלָיו.
(20) And in Moshe's coming to the tent of meeting to speak with Him: It is learned (Deuteronomy 34:10), “And no other prophet arose in Israel like Moshe” - in Israel, none did arise, but among the nations of the world, one did arise; so that there not be a claim open to the nations to say, “If we had a prophet like Moshe, we would have worshiped the Holy One, blessed be He. And which prophet did they have [that was] like Moshe? This was Bilaam the son of Beor. However there is a difference between the prophecy of Moshe and the prophecy of Bilaam: Three characteristics were in the hand of Moshe that were not in the hand of Bilaam. Moshe would speak with Him, standing; as it is stated (Deuteronomy 5:28), “And you stand with Me and I will speak to you, etc.” And with Bilaam, He would only speak with him prostrate, as it is stated (Numbers 24:4), “fallen and of open eyes.” Moshe would speak to Him 'mouth to mouth,' as it is stated (Numbers 13:8), “'Mouth to mouth' I speak to him.” And with Bilaam [it is written,] “Speaks the one who hears the speeches of God” – as He did not speak to him 'mouth to mouth.' Moshe would speak to him face to face, as it is stated (Exodus 33:11), “And the Lord spoke to Moshe face to face.” And with Bilaam, He only spoke in parables, as you say (Numbers 24:15), “And he started his parable, etc.” Three characteristics were in the hand of Bilaam that were not in the hand of Moshe: Moshe did not know who was speaking with him. Bilaam knew who was speaking with him, as it is stated, “Speaks the one who hears the speeches of God, who gazes upon the vision of the Almighty.” Moshe did not know when the Holy One, blessed be He, would speak to him, and Bilaam did know when the Holy One, blessed be He, would speak to Him; as it is stated, “and who knows the mind of the Most Elevated.” They [accordingly] told a parable about the king's butcher who knows what the king brings to his table and knows how much is spent for [what goes] on the king's table. So it was that Bilaam knew what the Holy One, blessed be He, would say to him in the future. Bilaam would speak with Him any time he wanted, as it is stated, “fallen and of open eyes” - he would prostrate himself on his face and immediately, his eye would be revealed about what he was asking; and Moshe did not speak to Him anytime he wanted. Rabbi Shimon says, “Moshe too would speak to Him anytime he wanted, as it is stated, 'And in Moshe's coming to the tent of meeting to speak with Him' - immediately, 'and Moshe heard the Voice speaking to him.'”
However, Bilaam is also accounted among the most wicked of figures in Tanakh:
שנו רבותינו: שני חכמים עמדו בעולם, אחד מישראל ואחד מעובדי כוכבים: אחיתופל מישראל, ובלעם מאומות העולם ושניהם נאבדו מן העולם.

Bilaam & Lavan in Midrash

A passage from Tanhuma associates Bilaam with none other than Lavan, the archetypical rabbinic villain:
עד הגל הזה זש"ה ותלחץ רגל בלעם אל הקיר (במדבר כב), הגל הוא הקיר לפי שעבר בלעם את השבועה שנשבע ליעקב שנאמר אם לא תעבור את הגל הזה ואת המצבה הזאת לרעה, ובלעם זה לבן שנאמר ארמי אובד אבי (דברים כו), ועל שבקש לכלות ישראל נקרא ארמי שנאמר ולכה זועמה ישראל לכך נפרע הקיר ממנו לפי שהוא העד על השבועה כדכתיב יד העדים תהיה בו בראשונה (דברים יד), וישבע בפחד אביו יצחק, ח"ו לא נשבע אותו צדיק בשמו של מלך אלא בחיי אביו כאדם הרוצה לאמת דבריו ואומר חי אבא אם אעשה זאת, ואף אותה שבועה לא נשבע לולי הפחד כדכתיב בן יכבד אב (מלאכי א):
This heap is witness between me and thee (Gen. 31:48). Scripture states elsewhere in reference to this verse: And crushed Balaam’s foot against the wall (Num. 22:25). The heap alluded to in our text was the very wall at which Balaam violated the promise he had made to Jacob, as it is said: I will not pass over this heap to harm you (Gen. 31:52). Balaam and Laban were one and the same,13Sanhedrin 105a. See Ginzberg, Legends of the Jews 6:123. for it is said of him: An Aramean was destroying my father (Deut. 26:5). Balaam was called an Aramean, because he desired to annihilate Israel, as is said: Come, execrate Israel (Num. 23:7). Hence, it was the very wall that had borne witness to the oath that he had made that called him to account, as is written: The hand of the witness shall be first upon him (Deut. 17:7). And Jacob swore by the Fear of his father, Isaac (Gen. 31:53). This righteous man did not swear by the name of the king, but rather on the life of his father. He did it just as a man who desires to prove the truth of this remarks says: “I swear by the life of my father.” He swore this oath only out of respect, as is written: A son shall honor his father (Mal. 1:6).
The Bilaam-Lavan connection is also explored in Bereshit Rabbah:
ויבא אלקים וגו' בחלום הלילה א"ר יוסי אין הקדוש ברוך הוא נגלה על נביאי אומות העולם אלא בשעה שדרך בני אדם לפרוש זה מזה הה"ד (איוב ד) בשעיפים מחזיונות לילה ואלי דבר יגונב וגו' מה בין נביאי ישראל לנביאי אומות העולם רבי חנינא בר פפא ורבנן רבי חנינא בר פפא אמר משל למלך שהיה נתון הוא ואוהבו בטרקלין וילון מונח ביניהם כל זמן שהיה רוצה לדבר עם אוהבו היה קופל את הוילון ומדבר עמו אבל לנביאי אומות העולם אינו מקפל אותו אלא מדבר עמהם מאחרי הוילון ורבנן אמרי למלך שהיה לו אשה ופלגש כשהוא הולך אצל אשתו הוא הולך בפרהסיא וכשהוא הולך אצל שפחתו הולך במטמוניות כך אין הקב"ה נגלה על אומות העולם אלא בלילה (במדבר כב) ויבא אלקים אל בלעם לילה (בראשית לא) ויבא אלקים אל לבן הארמי בחלום הלילה (שם כ) ויבא אלקים אל אבימלך בחלום הלילה מה בין נביאי ישראל לנביאי אומות העולם רבי חמא ב"ר חנינא ור' יששכר מכפר מנדי ר' חמא אמר אין הקדוש ברוך הוא נגלה על נביאי אומות העולם אלא בחצי דבור היך מה דאת אמר (במדבר כג) ויקר אלקים אל בלעם א"ר יששכר דכפר מנדי אין הלשון הזה ויקר אלא לשון טומאה היך מד"א (דברים כג) כי יהיה בך איש אשר לא יהיה טהור מקרה אבל נביאי ישראל בדבור שלם בלשון חיבה בלשון קדושה בלשון שמלאכי השרת מקלסין אותו שנאמר (ישעיה ו) וקרא זה אל זה ואמר קדוש וגו' א"ר יוסי בן ביבה (משלי טז) רחוק ה׳ מרשעים אלו נביאי אומות העולם ותפלת צדיקים ישמע אלו נביאי ישראל ויבא אלקים אל אבימלך ויאמר לו הנך מת על האשה וגו' מכאן שאין התראה בבני נח והיא בעולת בעל אמר רבי אחא בעלה נתעטר בה והיא לא נתעטרה בבעלה רבנן אמרי מרתא דבעלה בכ"מ האיש גוזר ברם הכא כל אשר תאמר אליך שרה שמע בקולה: