The Prophet ﷺ said, "When one of you prays, he should not spit in front of himself or to his right, but rather to his left or under his foot. Otherwise, he should do as the Prophet ﷺ did and spit into his garment, then rub it in."
أخبرنا محمد بن بشار عن محمد قال حدثنا شعبة قال سمعت القاسم بن مهران يحدث عن أبي رافع
عن النبي ﷺ قال إذا صلى أحدكم فلا يبزق بين يديه ولا عن يمينه ولكن عن يساره أو تحت قدمه وإلا فبزق النبي ﷺ هكذا في ثوبه ودلكه
Muslim recorded it in the Book of Masjids, chapter on the prohibition of spitting in the masjid, etc., hadith no. 550, from the hadith of Muhammad bin Jafar, from Shubah, with this wording. It is also found in Sunan al-Kubra, hadith no. 298.