In the seventh aliyah, since Bilam didn't curse the Jews in the last aliyah, Balak now again takes him to another place, the top of Peor, and Balak hopes that Bilam can curse the Jews from there. Again Rashi says that Balak knew this to be an unfavorable place for the Jews. Now for a third time they build seven altars and make offerings. Then Bilam begins, and blesses Israel a third time, this time with the famous blessing of "How Goodly are your tents oh Yakov" interpreted by Rashi to mean that he saw their tents arranged not opposite one another for the sake of tzniousness (modesty).
Bilam then begins a prophecy about the coming of Moshiach and what he will do to the nations in the final days including the destruction of Amalak. After this, Bilam and Balak go home. Then the Moavite young ladies come out and seduce Jewish men to be involved with Baal Peor, one of the Moavite gods. Rashi says that they did this on the advice of Bilam. G-D becomes angry and commands Moshe to hang the guilty people. Then, a Jewish man named Zimri publicly takes a Midianite woman to commit harlotry with her, and Pinchas, Aharon's grandson, takes a spear and kills them both in a miraculous way.