[Machine] Abu Dharr and I were with the Messenger of Allah ﷺ in the mosque when the sun began to set. He asked Abu Dharr, "Where does the sun go?" I replied, "Allah and His Messenger know best." He said, "Verily, it continues on its path until it prostrates beneath the throne of its Lord. Then, it seeks permission and is allowed to rise again. It is as if it is commanded to return to where it came from, and so it rises from its place. And that is its appointed resting place." Muhammad ﷺ then recited the verse: "And the sun runs [on course] toward its stopping point. That is the determination of the Exalted in Might, the Knowing." (Quran 36:38)
أَبُو ذَرٍّ بَيْنَمَا أَنَا مَعَ رَسُولِ اللهِ ﷺ فِي الْمَسْجِدِ حِينَ وَجَبَتِ الشَّمْسُ قَالَ يَا أَبَا ذَرٍّ أَيْنَ تَذْهَبُ الشَّمْسُ؟ قُلْتُ اللهُ وَرَسُولُهُ أَعْلَمُ قَالَ فَإِنَّهَا تَذْهَبُ حَتَّى تَسْجُدَ بَيْنَ يَدَيْ رَبِّهَا ﷻ ثُمَّ تَسْتَأْذِنُ فَيُؤْذَنُ لَهَا وَكَأَنَّهَا قَدْ قِيلَ لَهَا ارْجِعِي مِنْ حَيْثُ جِئْتِ فَتَطْلُعُ مِنْ مَكَانِهَا وَذَلِكَ مُسْتَقَرٌّ لَهَا قَالَ مُحَمَّدٌ ثُمَّ قَرَأَ {وَالشَّمْسُ تَجْرِي لِمُسْتَقَرٍّ لَهَا} [يس 38]