The Prophet ﷺ forbade praying when the upper edge of the sun is rising or when it is setting, and he said, "It rises between the two horns of a devil," or, "from between the two horns of a devil."
أن النبي ﷺ نهى أن يصلى إذا طلع قرن الشمس، أو غاب قرنها، وقال: إنها تطلع بين قرني شيطان أو من بين قرني شيطان.
Imam Ahmad (21661) narrated it from Affan, who said, Hammam told us, Qatada told us, from Ibn Sirin, from Zayd bin Thabit, and he mentioned it. Its chain of transmission is sahih.Related in meaning is what Saeed bin Nafi narrated, he said, Abu Bashir Ansari, a companion of the Messenger of Allah ﷺ, saw me praying the Duha prayer when the sun had just risen, and he criticized me for that and forbade me, then said, the Messenger of Allah ﷺ said, "Do not pray until the sun has risen higher, for it rises between the two horns of Shaytan."Ahmad (21889) narrated it, as did Bazzar in his Musnad (2304) and Abu Yaala as found in Ithaf Khayra (1276), all of them through Harun bin Maruf. He said, Makhrama (bin Bukayr) informed me, from his father, (1276) from Saeed bin Nafi, and he mentioned it.In this chain is Saeed bin Nafi, whom no one has confirmed as reliable. Ibn Hibban mentioned him among the trustworthy narrators (4/291) and mentioned only Bukayr bin Ashaj as the one who narrated from him, and he is counted among the people of Madinah, so he is "acceptable" in the terminology of Ibn Hajar.