Sahih Bukhari | Volume 1 | Hadith Number 400

Narrated by 'Abdullah bin 'Umar
Allah's Apostle saw sputum on the wall of the mosque in the direction of the Qibla and scraped it off. He faced the people and said, "Whenever any one of you is praying, he should not spit in front of him because in the prayer Allah is in front of him."