Nafi' narrates from Sayyiduna Ibn Umar (may Allah be pleased with them both) that he greeted a man with salam while the man was praying. The man replied to the greeting in words, so he said: "When one of you greets his Muslim brother while he is praying, he (the one praying) should not speak, but should gesture with his hand."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3404