Balak, the King of Moab, summons the prophet Bi'lam to curse the people of Israel. On the way, Bi'lam is berated by his donkey, who sees the angel that YHWH sends to block their way before Bi'lam does. Three times, from three different vantage points, Bi'lam attempts to pronounce his curses; each time, blessings issue instead. Bi'lam also prophecies on the end of days and the coming of Moshiach.
The people fall prey to the charms of the daughters of Moab and are enticed to worship the idol Peor. When a high-ranking Israelite official publicly takes a Midianite princess into a tent, Pinchas kills them both, stopping the plague raging among the people.
(adapted from chabad.org)