The Messenger of Allah ﷺ saw some phlegm on the wall of the mosque. He picked up a pebble and scraped it off, then said, "When one of you needs to expel phlegm while praying, he should not spit in front of him or to his right. Let him spit to his left or under his left foot."
حدثنا بشر بن شعيب بن أبي حمزة أخبرني أبي قال محمد يعني الزهري أخبرني حميد بن عبد الرحمن أن
أن رسول الله ﷺ رأى نخامة في حائط المسجد فتناول رسول الله ﷺ حصاة فحتها ثم قال إذا تنخم أحدكم وهو يصلي فلا يتنخم قبل وجهه ولا عن يمينه وليبصق عن يساره أو تحت قدمه اليسرى
Its isnad is sahih. Bishr bin Shuayb bin Abu Hamza is trustworthy and firmly reliable, as is his father. The hadith preceded at 11488.