كتاب الْمَسَاجِدِ وَمَوَاضِعِ الصَّلاَةِ
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 551

Anas b. Malik reported:

The Messenger of Allah (ﷺ) said: When any one of you is engaged in prayer, he is holding intimate conversation with his Lord, so none of you must spit in front of him, or towards his right side, but towards his left side under his foot.
حَدَّثَنَا مُحَمَّدُ بْنُ الْمُثَنَّى، وَابْنُ، بَشَّارٍ قَالَ ابْنُ الْمُثَنَّى حَدَّثَنَا مُحَمَّدُ بْنُ جَعْفَرٍ، حَدَّثَنَا شُعْبَةُ، قَالَ سَمِعْتُ قَتَادَةَ، يُحَدِّثُ عَنْ أَنَسِ بْنِ مَالِكٍ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ إِذَا كَانَ أَحَدُكُمْ فِي الصَّلاَةِ فَإِنَّهُ يُنَاجِي رَبَّهُ فَلاَ يَبْزُقَنَّ بَيْنَ يَدَيْهِ وَلاَ عَنْ يَمِينِهِ وَلَكِنْ عَنْ شِمَالِهِ تَحْتَ قَدَمِهِ ‏"‏ ‏.‏
Reference : Sahih Muslim 551
In-book reference : Book 5, Hadith 68
USC-MSA web (English) reference : Book 4, Hadith 1123
  (deprecated numbering scheme)