Numbers 22:22-28 (NRSV)
An angel speaks God's word to Balaam
God's anger was kindled because he was going, and the angel of the Lord took his stand in the road as his adversary. Now he was riding on the donkey, and his two servants were with him. The donkey saw the angel of the Lord standing in the road, with a drawn sword in his hand; so the donkey turned off the road, and went into the field; and Balaam struck the donkey, to turn it back onto the road. Then the angel of the Lord stood in a narrow path between the vineyards, with a wall on either side. When the donkey saw the angel of the Lord, it scraped against the wall, and scraped Balaam's foot against the wall; so he struck it again. Then the angel of the Lord went ahead, and stood in a narrow place, where there was no way to turn either to the right or to the left. When the donkey saw the angel of the Lord, it lay down under Balaam; and Balaam's anger was kindled, and he struck the donkey with his staff. Then the Lord opened the mouth of the donkey, and it said to Balaam, "What have I done to you, that you have struck me these three times?"