The Messenger of Allah ﷺ said, "When one of you stands to pray, what is in front of him serves as a barrier if it is the height of the rear of a camel saddle. If there is nothing in front of him the height of a camel saddle's rear, then his prayer is cut off by a donkey, a woman, or a black dog passing in front of him."I asked, "Abu Dharr, what distinguishes the black dog from the red dog or the yellow dog?"He replied, "Nephew, I asked the Messenger of Allah ﷺ just as you have asked me, and he said, 'The black dog is a devil.'"
قال رسول الله ﷺ: إذا قام أحدكم يصلي، فإنه يستره إذا كان بين يديه مثل آخرة الرحل، فإذا لم يكن بين يديه مثل آخرة الرحل فإنه يقطع صلاته الحمار والمرأة والكلب الأسود. قلت يا أبا ذر: ما بال الكلب الأسود من الكلب الأحمر من الكلب الأصفر؟ قال: يا ابن أخي! سألت رسول الله ﷺ كما سألتني فقال: الكلب الأسود شيطان.
Muslim narrated it in the Book of Prayer (510) through several routes from Yunus, from Humayd bin Hilal, from Abdullah bin Samit, from Abu Dharr, who mentioned the same thing. Ibn Khuzayma also narrated it (831), and from him Ibn Hibban (2391), through another route from Humayd bin Hilal, from Abdullah bin Samit, from Abu Dharr, as a raised hadith with the wording, "Prayer must be repeated because of a donkey, a woman, or a black dog passing by." I said, "Why the black one rather than the yellow one or the red one?" He said, "I asked the Messenger of Allah ﷺ just as you have asked me, and he said, 'The black dog is a devil.'"