"And God came unto Bilaam at nght and said unto him: 'If the men are come to call thee, rise up, go with them; but only the word which I speak unto thee, that thou shalt do.' And Bilaam rose up in the morning and saddled up his ass, and went with the princes of Moav. And God's anger was kindled because he went; and the angle of the Lord placed himself in the way for an adversary against him - Now he was riding upon his ass and his two servants were with him. And the ass saw the angel of the Lord standing in the way, with his sword drawn in his hand; and the ass turned aside out of the way, and went into the field; and Bilaam smote the ass to turn her into the way." (Bamidar 22:20-23)
Many commentators ask the obvious question: If God said Bilaam could go, why does He then get mad when he does?
For me, the answer is an obvious reference to marriage. Consider the situation: Bilaam asks God: Can I go with the prince of Moav? And God says no. Then Bilaam asks again and this time God says yes, but not in an unqualified fashion. Should Bilaam have perhaps read between the lines and realized that the way God said "yes" really meant "no"?
This is similar to marriage. Men, there are many times when you go up to your wife and ask if you can go out with the guys, perhaps to learn, perhaps to drink, perhaps to learn while drinking. And the wife says no. So what does the average man do? He asks again. And sometimes the wife then says yes. But does she mean it? Read between the lines. Her "yes" is really a "no". And if the man acts like Bilaam and actually treats the "yes" as a "yes", having failed (unintentionally or not) to catch the hidden meaning, then what happens?
He gets his ass whipped at least three times!