1. It is suggested that it is better to stand for forty years than cross the path of a person engaged in prayer. May I ask whether this applies to people offering prayers in the mosques in Makkah and Madinah?
2. Is it appropriate for a person engaged in his prayer to raise his hand to stop someone who inadvertently tries to cross in front of him?

1. It is strongly recommended that when a person offers his prayers he would put in front of him some sort of a barrier at a point which is a little farther than where he places his head on the ground when he prostrates himself. That barrier could be anything, whether wide or narrow. Even a stick is sufficient. If he has nothing to place in front of him then he may draw a line on the ground to separate his praying place [up to the point of prostration] from the surrounding area. When a person has placed such a shield or screen, then anyone who crosses his way beyond it does not have any effect on his prayer.

What you have mentioned is correct. A highly authentic Hadith quotes the Prophet, peace be upon him, as saying: “Had any person who crosses the path of someone engaged in prayer known what sin he incurs, he will have preferred to stop for forty years rather than cross his path.” [Related by Al-Bukhari and Muslim and others]. The Hadith does not specify whether the Prophet, peace be upon him, meant forty days or forty years. That is immaterial. Another Hadith related by Muslim quotes the Prophet, peace be upon him, as saying: “It is better for any of you to stand for one hundred years rather than cross the path of his brother when he is engaged in prayer.” The Prophet, peace be upon him, orders his followers to try to prevent anyone who is about to cross their path when they offer their prayer. But if someone crosses the path nevertheless, it does not affect the validity of the prayer itself.

An exception is made in Makkah, where the requirement of putting a shield or a screen does not apply. That is because of the enormous crowd that gathers in Makkah during pilgrimage and peak Umrah season. If a praying person is required to prevent everyone that intends to cross his path, he would not be able to concentrate on his prayer.

2. When a person prays, he is recommended to place a mark in front of him, just beyond the point where he prostrates himself. When such an object marking his place of prayer is clear, people must not cross in between the worshipper and the object marking his space. If anyone tries to cross, the worshipper should stop him with an indication by his hand. He should raise his hand and prevent that person from crossing.