Sayyiduna Tariq bin Abdullah Muharibi (may Allah be pleased with him) narrates that the Messenger of Allah (peace be upon him) said: "When you are in prayer, do not spit in front of you or to your right side, but spit to your left side; if it is not empty, then under your left foot, then rub it." Mansur says: That is, rub it into the ground.
Hadith Referenceصحيح ابن خزيمه / جماع أبواب الأفعال المباحة فى الصلاة / 877
Hazrat Abu Al-Ala bin Shikhir narrates from his father that he offered prayer with the Messenger of Allah (peace be upon him), and the Prophet (peace be upon him) spat out phlegm and rubbed it with his left shoe. Khalid has added in his narration that "and the Prophet (peace be upon him) was in a region with hard ground." Imam Abu Bakr (may Allah have mercy on him) says that Abu Al-Ala is Yazid bin Abdullah bin Al-Shikhir and is the brother of Mutarrif. The narrators of the hadith have attributed him to his grandfather. Imam Abu Bakr (may Allah have mercy on him) says that this hadith was narrated by Hammad bin Salamah from Jariri, who said, « عن ابي العلاء عن مطرف عن ابيه »
Hadith Referenceصحيح ابن خزيمه / جماع أبواب الأفعال المباحة فى الصلاة / 878
Hazrat Mutarrif narrates from his father that I saw the Messenger of Allah (peace be upon him) praying, and he spat under his left foot. Hazrat Alaa added that then he rubbed it in.
Hadith Referenceصحيح ابن خزيمه / جماع أبواب الأفعال المباحة فى الصلاة / 879