In the name of Allah, Most Beneficient, Most Merciful
It is related that the Prophet (صلى الله عليه وسلم) said ‘If the one passing in front of the one praying knew what was against him, his waiting forty would be better for him than passing in front of him.’ [Bukhari] Abu al-Nadr, one of the sub narrators, said ‘I don’t know whether he said forty days, or months or years’. In a version narrated by al-Bazzar the hadith reads ‘forty autumns’.
The offence being as serious as it is, the scholars defined what constitutes passing in front of somebody praying. If the one praying is in an open space or a large mosque, the scholars differed concerning what is considered passing in front, both opinions being deemed strong and follow-able. One opinion is that it is passing by his place of prostration, such that if one where to pass in front of him but beyond his immediate place of prostration there would be no sin upon one. The other opinion, which is ibn Abidins preference, is that one would be considered passing in front if one is within the field of vision of the one praying if his eyes were fixed on his place of prostration.
If the one praying is in a room or a small mosque then one will be sinful for passing in front regardless of how far in front of him one is. Ibn Abidin defines a small mosque as being forty cubits.
However, is the one passing in front always to blame?
The possible scenarios that may occur are four,
1. The one passing has an alternative to passing in front and the one praying did not pray in a place where he is in people’s way.
-In this case the sin is only on the one passing.
2. The one passing has no alternative to passing and the one praying was in a place where he would be in people’s way.
-The sin in this case is solely on the one praying.
3. The one passing has an alternative to passing in front and the one praying was in a place where he would get in people’s way.
-The sin is on both of them.
4. Neither does the one passing have an alternative nor is the one praying in people’s way. -The sin is on neither of them.
In all of these cases the one passing in front would be free from sin if the one praying were to keep a sutra in front of him. A sutra is an object of about a cubit in height that one places in front of one as one prays.
One last scenario that is relevant to mention is that if someone prays near the entrance of the mosque or without filling in the gaps in the row in front, one can walk in front of him to fill in the gaps. [Radd al-Muhtar, 1:427, Dar Li Ihya al-Turath al-‘Arabi]
Looking now to the question at hand, if the mosque is considered a large mosque then there is no problem at all as there is no harm in walking in front of somebody by a few metres in a small mosque. If it is not a large mosque then there still is no sin on the men as they are walking to fill in the rows which they can not do with out walking in front of the women.
And Allah knows best.