(במדבר כד, יד) הנני הולך לעמי לכה איעצך אשר יעשה העם הזה לעמך עמך לעם הזה מיבעי ליה א"ר אבא בר כהנא כאדם שמקלל את עצמו ותולה קללתו באחרים
§ Balaam said to Balak: “Behold, I go to my people; come therefore, and I shall advise you what this people shall do to your people” (Numbers 24:14). Ostensibly, he should have said: What your people shall do to this people. Rabbi Abba bar Kahana says: Balaam spoke like a person who curses himself but does not wish to utter so awful a matter and instead ascribes his curse to take effect on others.
אמר להם אלהיהם של אלו שונא זימה הוא והם מתאוים לכלי פשתן בוא ואשיאך עצה עשה להן קלעים והושיב בהן זונות זקינה מבחוץ וילדה מבפנים וימכרו להן כלי פשתן
Balaam said to them: The God of these Jewish people despises lewdness, and they desire linen garments, as they have no new garments; come, and I will give you advice. Make for them enclosures using wall hangings and seat prostitutes in them, with an old woman outside the enclosure and a young woman inside, and have the women sell them linen garments.
עשה להן קלעים מהר שלג עד בית הישימות והושיב בהן זונות זקינה מבחוץ וילדה מבפנים ובשעה שישראל אוכלין ושותין ושמחין ויוצאין לטייל בשוק אומרת לו הזקינה אי אתה מבקש כלי פשתן זקינה אומרת לו בשוה וילדה אומרת לו בפחות שתים ושלש פעמים
Balak made for them enclosures using wall hangings from the snow mountain, the Ḥermon, until Beit HaYeshimot, and he sat prostitutes in them, with an old woman outside and a young woman on the inside. And at the time when Jewish people were eating and drinking and were glad and going out to stroll in the marketplace, the old woman would say to a Jew: Aren’t you seeking linen garments? He would enter the enclosure and ask the price, the old woman would quote him a price equal to its value, and the young woman would quote him a price less than its value. That scenario would repeat itself two or three times.
ואח"כ אומרת לו הרי את כבן בית שב ברור לעצמך וצרצורי של יין עמוני מונח אצלה ועדיין לא נאסר (יין של עמוני ולא) יין של נכרים אמרה לו רצונך שתשתה כוס של יין כיון ששתה בער בו
And thereafter she [the young one] would say to him: You are like a member of our household, sit and choose for yourself the merchandise that you want. And a jug of Ammonite wine was placed near her, and neither Ammonite wine nor gentile wine had been prohibited yet for Jews. She said to him: Is it your wish to drink a cup of wine? Once he drank the wine, his evil inclination burned within him.
He then said to her: Submit to me and engage in intercourse with me. She then removed the idol that she worshipped from her lap and said to him: Worship this. He said to her: Am I not Jewish? I am therefore forbidden from engaging in idol worship. She said to him: And what is your concern? We are asking you to do nothing more than defecate in its presence. But he does not know that its worship is conducted in that manner. Once he did so, she said to him: Moreover, I will not leave you until you deny the Torah of Moshe your teacher, as it is stated: “But when they came to Ba’al-Peor they separated themselves to the shameful item; and they became detestable like that which they loved” (Hosea 9:10). They devoted themselves to the disgrace of defecation, and detested the name of God.
Sanhedrin 106