Hadith Q876

َفِيهِ مَا دَلَّ عَلَى إِبَاحَةِ لَيِّ الْمُصَلِّي عُنُقَهُ وَرَاءَ ظَهْرِهِ إِذَا أَرَادَ أَنْ يَبْصُقَ فِي صَلَاتِهِ، إِذِ الْبَزْقُ خَلْفَهُ غَيْرُ مُمْكِنٍ إِلَّا بِلَيِّ الْعُنُقِ
And in this is evidence that it is permissible for the one praying to turn his neck backwards when he intends to spit, because spitting backwards is not possible without turning the neck.
Hadith Reference صحيح ابن خزيمه / جماع أبواب الأفعال المباحة فى الصلاة / Q876