كتاب الْمَسَاجِدِ وَمَوَاضِعِ الصَّلاَةِ
5  
The Book of Mosques and Places of Prayer
(13)
Chapter: The prohibition of spitting in the masjid, during prayer and at other times. The prohibition of a praying person spitting in front of him or to his right
(13)
باب النَّهْىِ عَنِ الْبُصَاقِ، فِي الْمَسْجِدِ فِي الصَّلاَةِ وَغَيْرِهَا ‏‏
Sahih Muslim 549

'A'isha reported:

The Apostle of Allah (may, peace be upon him) saw spittle or snot or sputum, sticking to the wall towards Qibla and scratched it off.
وَحَدَّثَنَا قُتَيْبَةُ بْنُ سَعِيدٍ، عَنْ مَالِكِ بْنِ أَنَسٍ، فِيمَا قُرِئَ عَلَيْهِ عَنْ هِشَامِ بْنِ عُرْوَةَ، عَنْ أَبِيهِ، عَنْ عَائِشَةَ، أَنَّ النَّبِيَّ صلى الله عليه وسلم رَأَى بُصَاقًا فِي جِدَارِ الْقِبْلَةِ أَوْ مُخَاطًا أَوْ نُخَامَةً فَحَكَّهُ ‏.‏
Reference : Sahih Muslim 549
In-book reference : Book 5, Hadith 65
USC-MSA web (English) reference : Book 4, Hadith 1120
  (deprecated numbering scheme)