What would you do if God gave you the gift of Prophecy? Sit at home and keep it for yourself, use it to curse others, or sell it to the higher bidder?
Such were the choices that Balaam, a man gifted with the gift of prophecy. Balaam was not an Israelite, which shows that the Spirit goes where it wishes. Very little is known of him until he is summoned by Balak the Moabite king who asks Balaam to curse Israel for he knows that curse spoken by Balaam as the oracle of the Lord will stand.
In so doing, Balak commits a grave mistake that we are tempted to commit every day: to make God do our bidding. In other words, to act like a magician conjuring powerful spirits at his commands, spirits who will fulfill his wish and act as an extension of his own will.
Balaam may have known better but the lure of gold was too strong and besides Israel were not his people. He complies and instead of curses, he blesses Israel -- twice, which goes to show that God's will is done by the good and the wicked.
What of God? Should he not have warned Balaam of his error? Actually, God did, in the most wondrous way: he opens the mouth of Balaam's donkey and she speaks words of wisdom, reminiscent of the words St. John the Baptist will speak to the Pharisees of his time: "do not presume to say to yourselves, 'We have Abraham as our father'; for I tell you, God is able from these stones to raise up children to Abraham." (Matt. 3:9). The choice of a donkey and stones is not coincidental: the donkey is stubborn and stiff-necked like the pride of man, and the stone is hard, hard as a human heart.