(Related by Al-Bukhari).
As he was going to the mosque to join a congregational prayer, one of the Prophet's (Pbuh) companions felt that he was late. He walked fast, or he might have run.
Arriving in the mosque, he saw that the congregational prayer was in progress. As he was going forward to join the congregation, the Prophet bowed for ruku', so the latecomer joined the prayer and bowed even before he reached the last row of the congregation. He did so in order not to miss one rak'ah, which is the unit of Islamic prayers. He walked over to the last row while he was in the bowing position. His breathing could be heard by those around him. When the prayer was over the Prophet (peace be upon him) asked the person concerned to identify himself and a short conversation took place. Different Hadiths give different versions of the case, with more details of the conversation. Here is the shorter, more authentic version: "Abu Bakrah reports that he arrived when the Prophet was in the bowing position. He bowed before reaching the (last) row. He mentioned this to the Prophet who said to him, 'May God make you even keener, but do not do this again'." (Related by Al-Bukhari).
In its longer versions, the Hadith tells us that Abu Bakrah arrived in the mosque when the Prophet was bowing but before he lifted his head. This means that he could catch up with the rak'ah in progress if he joined before the imam stood up. As the ruku' normally takes less than 10-20 seconds, Abu Bakrah realized that he would miss the rak'ah if he delayed joining the prayer until he had reached the last row. Therefore, he joined where he was and walked in the bowing position a couple of steps to reach the row. On finishing the prayer, the Prophet wanted to know who the latecomer was in order to give him advice. His question was very specific: "Who was it that bowed before joining the row?"
Abu Bakrah's action involved three mistakes: Running in the street to join the prayer, bowing before reaching the last row and walking to join the row while bowing. None of these mistakes actually invalidates the prayer; otherwise, the Prophet would have told him to repeat his prayer. However, they are not right. Prayer is an act of communication between us and God. It should not be approached in a hurry. It is not right to run or walk too fast, arriving in the mosque when we are short of breath. If we miss a part of the congregational prayer, it is not like missing a train or a plane. We complete the prayer after the imam has finished. God rewards us for our intention. We should come to the mosque walking comfortably.
If one starts his prayer before taking his position in the congregation, he is separating himself, which is not right. Nor is it right to walk over while praying in order to join the row. It is better to delay joining the congregation, even if one misses a rak'ah as a result. The reward for congregational prayer, which is 27 times the normal reward for praying alone, is granted by God even if one arrives late. Therefore, the proper thing to do is to walk up to the last row and then join the prayer at ease.
As we have said, these mistakes do not invalidate the prayer. The Prophet (peace be upon him) did not order Abu Bakrah to repeat his prayer. He prayed for him so as to increase his keenness to join congregational prayers on time, but the Prophet ordered him not to repeat these mistakes. We should learn this lesson and refrain from running to join the prayer, even on Fridays. If we are late and miss the congregation, we pray alone and hope for God's reward for our intention to join the congregational prayer. God is always generous with His reward.