Mishkat al-Masabih 746
وَعَن أنس: رَأَى النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ نُخَامَةً فِي الْقِبْلَةِ فَشَقَّ ذَلِكَ عَلَيْهِ حَتَّى رُئِيَ فِي وَجهه فَقَامَ فحكه بِيَدِهِ فَقَالَ: «إِنَّ أَحَدَكُمْ إِذَا قَامَ فِي صلَاته فَإِنَّمَا يُنَاجِي ربه أَو إِن رَبَّهُ بَيْنَهُ وَبَيْنَ الْقِبْلَةِ فَلَا يَبْزُقَنَّ أَحَدُكُمْ قِبَلَ قِبْلَتِهِ وَلَكِنْ عَنْ يَسَارِهِ أَوْ تَحْتَ قَدَمِهِ» ثُمَّ أَخَذَ طَرَفَ رِدَائِهِ فَبَصَقَ فِيهِ ثُمَّ رَدَّ بَعْضَهُ عَلَى بَعْضٍ فَقَالَ: «أَوْ يفعل هَكَذَا» . رَوَاهُ البُخَارِيّ
And from Anas: The Prophet ﷺ saw phlegm on [the wall of] the qiblah, and that was hard on him until it was seen in his face. He stood up and scraped it off with his hand, and said: "When one of you stands in his prayer, he is speaking privately with his Lord" — or: "his Lord is between him and the qiblah" — "so let none of you spit in the direction of his qiblah, but to his left or under his foot." Then he took the edge of his cloak, spat in it, then folded part of it over part, and said: "Or let him do like this." Reported by al-Bukhari.