Abu Huraira reported God’s Messenger as saying, "The best of the men’s rows is the first and the worst is the last, but the best of the women’s rows is the last and the worst is the first.”
God’s Messenger came out to us and when he saw us sitting in circles he said, “How is it that I see you in separate companies?” On another occasion he came out to us and said, “Why do you not draw yourselves up in rows as the angels do in the presence of their Lord?” We asked, "Messenger of God, how do the angels draw themselves up in rows in the presence of their Lord?” He replied, "They make the first rows complete and keep close together in the row.”
Anas reported God’s Messenger as saying, "Stand close together in your rows, bring them near one another, and stand neck to neck, for by Him in whose hand my soul is, I see the devil coming in through openings in the row like a number of small black sheep.”
Abu Sa'id al-Khudri told that when God’s Messenger saw a tendency among his companions to go to the back he said to them, “Come forward and follow my lead, and let those who come after you follow your lead. People will continue to keep to the back till God will put them at the back.”*
* This has been explained as referring to their being denied God’s grace, or their lacking rank or knowledge. But cf. the tradition from 'A’isha at the end of Section III.