Sayyiduna Abu Dharr (may Allah be pleased with him) relates: "When there is nothing in front of the person praying equal to the back of a saddle, then a woman, a donkey and a black dog (by passing in front) break his prayer." The narrator says: I said: "O Abu Dharr, what is the reason for the black colour? Why is the prayer not broken by a red or white dog?" Abu Dharr (may Allah be pleased with him) said: "Nephew, I asked the Messenger of Allah (peace and blessings be upon him) just as you have asked me, and the Messenger of Allah (peace and blessings be upon him) said: 'The black dog is a devil.'"
Muhammad bin Isma'il al-Bukhari refrained from using the narration of Abdullah bin al-Samit as evidence, while other huffaz used it as evidence.
Imam al-Shafi'i (may Allah have mercy on him) indicated that this hadith is weak, and the narration contrary to it is more established than it. So either it is not preserved (ghayr mahfuz), or what is meant is that when these things pass in front of the person praying they cause heedlessness in the prayer and cut off his attention, not that the prayer becomes invalid by it; and interpreting the hadith in this way is better.
We take the chain of this hadith as evidence, and it has some supporting narrations which, like it, have authentic chains.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3484