It is narrated from Sayyiduna Jabir (may Allah be pleased with him): the Messenger of Allah (peace and blessings be upon him) sent me on an errand. When I returned, I found him in prayer. I greeted him with salam and he gestured towards me. Then, when the Messenger of Allah (peace and blessings be upon him) had finished, he called me and said: "You greeted me with salam just now while I was praying (that is why I did not reply)." At that time he was facing towards the east.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3396