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: "When you spit, do not spit in front of you or to your right; rather spit to your left, if it is empty, or under your foot."
Related hadith on this topic