Moses is taught the laws of the Red Heifer, whose ashes purify a person who has been contaminated by contact with a dead body.

After 40 years of journeying through the desert, the people of Israel arrive in the wilderness of Zin. Miriam dies and the people thirst for water. G‑d tells Moses to speak to a rock and command it to give water. Moses gets angry at the rebellious Israelites and strikes the stone. Water issues forth, but Moses is told by G‑d that neither he nor Aaron will enter the Promised Land.

Aaron dies at Hor Hahar and is succeeded in the High Priesthood by his son Elazar. Venomous snakes attack the Israelite camp after yet another eruption of discontent in which the people "speak against G‑d and Moses"; G‑d tells Moses to place a brass serpent upon a high pole, and all who will gaze heavenward will be healed. The people sing a song in honor of the miraculous well that provided the water in the desert. Moses leads the people in battles against the Emorite kings Sichon and Og (who seek to prevent Israel's passage through their territory) and conquers their lands, which lie east of the Jordan.

Balak, the King of Moab, summons the prophet Balaam to curse the people of Israel. On the way, Balaam is berated by his donkey, who sees the angel that G‑d sends to block their way before Balaam does. Three times, from three different vantage points, Balaam attempts to pronounce his curses; each time, blessings issue instead. Balaam 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.