Balaam was a "prophet" among the Midianites who, although he was somewhat aware of the true God, would preach almost anything that he was paid to i.e. he was a religious harlot (in Christ's own words, "many" of the pulpits of the Christian-professing world are today riddled with them - see Matthew 7:21-27; also The Spirit Of The World). When the Israelites arrived at Moab on the way to their physical promised land, the king of Moab hired Balaam to prophesy evil upon the people of Israel.
"22:1 And the children of Israel set forward, and pitched in the plains of Moab on this side Jordan by Jericho.
22:2 And Balak the son of Zippor saw all that Israel had done to the Amorites. 22:3 And Moab was sore afraid of the people, because they were many: and Moab was distressed because of the children of Israel.
22:4 And Moab said unto the elders of Midian [see also The Midian War], Now shall this company lick up all that are round about us, as the ox licketh up the grass of the field.
And Balak the son of Zippor was king of the Moabites at that time. 22:5 He sent messengers therefore unto Balaam the son of Beor to Pethor, which is by the river of the land of the children of his people, to call him, saying, Behold, there is a people come out from Egypt: behold, they cover the face of the earth, and they abide over against me: 22:6 Come now therefore, I pray thee, curse me this people; for they are too mighty for me: peradventure I shall prevail, that we may smite them, and that I may drive them out of the land: for I wot that he whom thou blessest is blessed, and he whom thou cursest is cursed." (Numbers 22:1-6 KJV)
"Through covetousness shall they with feigned words make merchandise of you: whose judgment now of a long time lingereth not, and their damnation slumbereth not"
When Balaam set off to meet with his latest employer, he found his route blocked, by an angel - that Balaam's talking donkey (see the Fact Finder question below) was able to see, while Balaam didn't.
"22:21 And Balaam rose up in the morning, and saddled his ass, and went with the princes of Moab. 22:22 And God's anger was kindled because he went: and the angel of the LORD stood in the way for an adversary against him. Now he was riding upon his ass, and his two servants were with him.
22:23 And the ass saw the angel of the LORD standing in the way, and his sword drawn in his hand: and the ass turned aside out of the way, and went into the field: and Balaam smote the ass, to turn her into the way.
22:24 But the angel of the LORD stood in a path of the vineyards, a wall being on this side, and a wall on that side. 22:25 And when the ass saw the angel of the LORD, she thrust herself unto the wall, and crushed Balaam's foot against the wall: and he smote her again.
22:26 And the angel of the LORD went further, and stood in a narrow place, where was no way to turn either to the right hand or to the left. 22:27 And when the ass saw the angel of the LORD, she fell down under Balaam: and Balaam's anger was kindled, and he smote the ass with a staff.
22:28 And the LORD opened the mouth of the ass, and she said unto Balaam, What have I done unto thee, that thou hast smitten me these three times?
22:29 And Balaam said unto the ass, Because thou hast mocked me: I would there were a sword in mine hand, for now would I kill thee.
22:30 And the ass said unto Balaam, Am not I thine ass, upon which thou hast ridden ever since I was thine unto this day? was I ever wont to do so unto thee?
And he said, Nay." (Numbers 22:21-30 KJV)
The angel of the LORD then made clear what Balaam was to prophesy.
"22:31 Then the LORD opened the eyes of Balaam, and he saw the angel of the LORD standing in the way, and his sword drawn in his hand: and he bowed down his head, and fell flat on his face.
22:32 And the angel of the LORD said unto him, Wherefore hast thou smitten thine ass these three times? behold, I went out to withstand thee, because thy way is perverse before me:
22:33 And the ass saw me, and turned from me these three times: unless she had turned from me, surely now also I had slain thee, and saved her alive.
22:34 And Balaam said unto the angel of the LORD, I have sinned; for I knew not that thou stoodest in the way against me: now therefore, if it displease thee, I will get me back again.
22:35 And the angel of the LORD said unto Balaam, Go with the men: but only the word that I shall speak unto thee, that thou shalt speak. So Balaam went with the princes of Balak.
22:36 And when Balak heard that Balaam was come, he went out to meet him unto a city of Moab, which is in the border of Arnon, which is in the utmost coast.
22:37 And Balak said unto Balaam, Did I not earnestly send unto thee to call thee? wherefore camest thou not unto me? am I not able indeed to promote thee to honour?
22:38 And Balaam said unto Balak, Lo, I am come unto thee: have I now any power at all to say any thing? the word that God putteth in my mouth, that shall I speak." (Numbers 22:31-38 KJV)
Fact Finder: Is Balaam described in the New Testament as a typical false prophet who brings destruction upon himself?
2 Peter 2:1-3, 2:15-16; see also False Christs and False Prophets