The Prophet ﷺ said one day, "Do you know where this sun goes?"They replied, "Allah and His Messenger know best."He said, "It travels until it reaches its resting place beneath the Throne, where it falls down in prostration. It remains like that until it is told, 'Rise and return from where you came,' so it returns and rises in the morning from its place of rising. Then it travels again until it reaches its resting place beneath the Throne, where it falls down in prostration. It remains like that until it is told, 'Rise and return from where you came,' so it returns and rises in the morning from its place of rising. Then it travels, with people noticing nothing unusual about it, until it reaches that resting place beneath the Throne, and it is told, 'Rise, and rise tomorrow from your place of setting,' so it rises in the morning from its place of setting."Then the Messenger of Allah ﷺ said, "Do you know when that will be? It will be when no soul will benefit from its faith if it had not believed before or earned good through its faith."
أن النبي ﷺ قال يوما: أتدرون أين تذهب هذه الشمس؟ قالوا: الله ورسوله أعلم قال: إن هذه تجري حتى تنتهي إلى مستقرها تحت العرش فتخر ساجدة، فلا تزال كذلك حتى يقال لها: ارتفعي ارجعي من حيث جئت، فترجع فتصبح طالعة من مطلعها، ثم تجري حتى تنتهي إلى مستقرها تحت العرش فتخر ساجدة، ولا تزال كذلك حتى يقال لها ارتفعي ارجعي من حيث جئت، فترجع فتصبح طالعة من مطلعها ثم تجري لا يستنكر الناس منها شيئا حتى تنتهي إلى مستقرها ذاك تحت العرش فيقال لها: ارتفعي أصبحي طالعة من مغربك فتصبح طالعة من مغربها فقال رسول الله ﷺ: أتدرون متى ذاكم ذاك؟ حين لا ينفع نفسا إيمانها لم تكن آمنت من قبل أو كسبت في إيمانها خيرا.
Bukhari narrated it in the Book of the Beginning of Creation (3199), and Muslim in the Book of Faith (159:250), both through the route of Ibrahim bin Yazid Taymi, from his father, from Abu Dharr, and he mentioned it. This is the wording of Muslim, while Bukhari related it in summarized form. In another wording from Muslim, "It goes and asks permission to prostrate, and it is granted permission, and it is as if it were told, 'Go back to where you came from,' so it rises from its place of setting." He said, then he recited, according to the reading of Abdullah, "and that is its fixed resting place" [Yasin 36:38].