Wa alaykum Salam Wa RAhmatullah,
There been some replies to this thread, and they didnt really cover things properly. Please, if a person doesnt know, then dont reply.
Use only the Quran and Sunnah and the sayings of the Scholars. Islam is based on evidences of Quran and Sunnah and the understanding of the scholars.
You can not speak in prayer,
However you can however lift your arm in prayer, to indicate your reply.
Please see link below, which by Shaykh Mashoor Hassan:
http://www.turntoislam.com/forum/showthread.php?p=133560
Abu Hurayrah(radhiyallahu anhu) reports from the Messenger of Allaah that he said, "when one of you meets his brother then let him give him the salaam. If a tree, wall or rock divides them then let them give the salaam upon meeting again." [Sunan Abu Daawood [Eng. Trans. 3/1435 no. 5181] and its isnaad is saheeh consisting of trustworthy and precise narrators. Refer to 'Silisilah as-Saheehah' no. 186]
This hadeeth contains evidence for the Muslims to greet one another when they meet due to this act inculcating unity, absence of hatred and mutual love. The command that is mentioned in this hadeeth is one of recommendation and not obligation.
With respect to this there is no difference between the one who is in the Mosque or outside of the Mosque. Indeed the Sunnah proves that it is legislated to give the salaam to whosoever is in the Mosque regardless of whether he is in prayer or not.
Ibn Umar (Radhiyallahu anhu) reports that "The Messenger of Allaah went to Qubaa to pray there. The Ansaar came to him and greeted him while he was in prayer. I asked Bilaal, 'how did you see the Messenger of Allaah replying to them when they greeted him while he was in prayer?' He replied, 'in this way.' Ja`far bin Awn demonstrated by extending his palm, keeping its inner side facing down and its back side facing up." [Abu Daawood [Eng. Trans. 1/236 no, 927] and Ahmad [2/30] with a saheeh isnaad meeting the conditions of Bukhaaree and Muslim. Refer to 'Silsilah as-Saheehah' [no. 185]]
Imams Ahmad and Ishaaq bin Rahaawayah took to this opinion. Al-Marwazee said, "I asked Ahmad, 'should one greet the people while they are in prayer?' He replied, 'yes and mentioned the story in which ibn Umar asked Bilaal how the Prophet replied to the salaam and his reply that he did so by indicating.' Ishaaq gave the same reply." ['Masaa`il al-Marwazee' [pg. 22]]
This was also the opinion that Qaadee ibn al-Arabee chose saying, "It is possible that indicating in prayer occur to reply to a salaam just as it is possible that one indicates due to a need that presented itself to him. If it is to reply to the salaam then there are a number of authentic narrations concerning this such as the action of the Prophet in Qubaa and other places." ['Aaridah al-Ahwadhee' [2/162]]