Humayd bin Abd al-Rahman narrates that he heard Sayyiduna Abu Hurayrah and Sayyiduna Abu Sa'id al-Khudri (may Allah be pleased with them both) say that the Messenger of Allah (peace and blessings be upon him) saw phlegm on the qiblah wall, so he took a pebble and scraped it off, then said: "None of you should spit towards the qiblah, nor to his right; rather, let him spit to his left or under his left foot."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3601