Since his arrival in Madinah, Rasulallah himself led the prayers at his mosque at all times. This was really a high office and was not given to anybody in the presence of Rasulallah - after all who could lead the Prayer when the Imam of all Imams was present?
However, a few months after his return from the Farewell Pilgrimage in 10 A.H., Rasulallah fell ill. A time came when he was unable to move and could not go to the Mosque to lead the prayer. He had to appoint someone as the Imam and this honour fell to Hazrat Abu Bakr. Hazrat Abu Bakr's daughter, Hazrat Aisha was one of the most beloved wives of Rasulallah . She knew that Hazrat Abu Bakr was a soft hearted man and it would be rather hard for him to replace Rasulallah in the case of being an Imam. Thus, she pleaded with Rasulallah to excuse Hazrat Abu Bakr from this duty but Rasulallah did not change his decision even though he was requested three times.
During those days, there was one time when Hazrat Abu Bakr was not present at the time of the congregational prayer. Somebody asked Hazrat Umar to lead the prayer instead. Rasulallah after hearing the voice of Hazrat Umar enquired about the Imam and when he found that Hazrat Abu Bakr was not leading he was annoyed and said, "Nobody will lead the Salat besides Ibn Abu Qahafa (i.e. Hadrat Abu Bakr)". Then Hazrat Abu Bakr (R.A.) was called but by that time Hazrat Umar had completed the prayer. The prayer was repeated by the order of Rasulallah and this time Hazrat Abu Bakr led it.
During his sickness, Rasulallah once felt some relief and went for Zuhr prayer, supported by Hazrat Ali and Hazrat Abbas . His blessed face beamed with joy and full satisfaction on seeing Hazrat Abu Bakr leading the prayer. Sensing the presence of Rasulallah , Hazrat Abu Bakr wanted to step back but Rasulallah stopped him and sat down by his side.
After the prayer, Rasulallah gave his last address: "Allah offered one of His servants the choice of the life on this earth and a life with Him. The servant accepted the latter". Hearing this tears came out of Hazrat Abu Bakr's eyes and rolled down to his beard. He thought of the inevitable separation from his Beloved Master, Rasulallah . Most of the people did not understand the meaning of Rasulallah 's address and they were surprised at Hazrat Abu Bakr's crying.
Early in the morning of the last day of his life, Rasulallah 's condition suddenly became better for a while. As his house was joined to the Mosque, he raised the curtain and observed the Muslims busy in prayer under the Imamat (leadership) of Hazrat Abu Bakr . A smile lit up the pale face of Rasulallah . Seeing the sign of Rasulallah 's recovery, the people in the Mosque lost concentration, due to the sheer delight. They might have fallen out of the line but Rasulallah smiled and simply asked Hazrat Abu Bakr to lead the prayer. Then he went inside and let the curtain fall.
Reference: http://www.alahazrat.net/islam/kissing-the-thumbs-on-hearing-the-name-of-the-beloved-prophet.php