It is narrated from Sayyiduna Tariq bin Abdullah al-Muharibi (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said to me: "When you are in prayer, do not ever spit in front of you or to your right; rather spit to your left, and if that place is not empty, then spit under your left foot, then rub it."
Mansur (may Allah have mercy on him) said (explaining "qul bihi"): "That is, rub it into the ground."
Related hadith on this topic