The Prophet ﷺ saw some phlegm on the qiblah wall. Sometimes he would say that he scraped it off, and at other times he would say, "I stood up and scraped it off."Then he said, "Would any of you like, while he is in prayer, for someone to spit phlegm in his face or to spit in his face? When any of you is in prayer, let him not spit in front of him, nor to his right, but to his left, beneath his foot. If he cannot do that," and he gestured with his garment in this manner.
حدثنا عفان قال حدثنا شعبة قال قاسم بن مهران أخبرنيه قال سمعت أبا رافع يحدث
أن النبي ﷺ رأى نخامة في القبلة قال كان يقول مرة فحتها قال ثم قال قمت فحتيتها ثم قال أيحب أحدكم إذا كان في صلاته أن يتنخع في وجهه أو يبزق في وجهه إذا كان أحدكم في صلاته فلا يبزقن بين يديه ولا عن يمينه ولكن عن يساره تحت قدمه فإن لم يجد قال بثوبه هكذا
Its chain of transmission is sahih. Abu Rafi Nufay the goldsmith is trustworthy and reliable. Bukhari related it, 1/112, in the book of prayer, chapter on scraping spit from the masjid, as did Muslim, 1/389, no. 550, in the book of masjids, chapter on the prohibition of spitting in masjids, and Abu Dawud, 1/129, no. 478, in the book of prayer, chapter on the dislike of spitting in the masjid, and Nasai, 1/51, no. 724, spit landing on clothing.