It is narrated from Sayyiduna Abu Dharr (may Allah be pleased with him) that he related: "I entered the mosque when the sun had set, and the Prophet (peace and blessings be upon him) was seated. He (peace and blessings be upon him) asked me: 'O Abu Dharr, do you know where this (sun) goes?' I said: 'Allah and His Messenger (peace and blessings be upon him) know best.' He (peace and blessings be upon him) said: 'It goes and seeks permission to prostrate (beneath the Throne), and permission is given to it. Then it is about to be told: Go back (that is, rise) from where you came. So it will rise from its own place of setting.' Then he (peace and blessings be upon him) recited this blessed verse according to the reading of Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him): 'And that is its resting place.'"
This chain is sahih, and Ibrahim (mentioned in the chain) is Ibrahim bin Yazid bin Sharik.