All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu 'alyhi wa sallam, is His slave and Messenger.
This is a Hadeeth (narration) transmitted on the authority of Abu Hurayrah . He said that the Prophet, sallallaahu ‘alayhi wa sallam, told them that the sun and moon would be gathered and wrapped and their light would vanish on the Day of Judgment. [Al-Bukhari] The narration of Al-Bukhari did not mention that they will be in Hell, however, this addition was narrated by some Hadeeth scholars, such as At-Tahaawi, Al-Bayhaqi, Al-Bazzaar and others . [Al-Albaani: (Saheeh)]
If this additional text is authentic then what is the meaning of being in Hell? Al-Haafith Ibn Hajar mentioned the narration of Al-Bazzaar and others that includes this additional text after mentioning the narration of Al-Bukhari . It was reported that Al-Hasan wondered why they would be in Hell if they have not committed a sin. Abu Salamah therefore rejected this comment, saying that this is the Hadeeth of the Prophet, sallallaahu ‘alayhi wa sallam, and we should not object to it because it is a revelation from Allaah The Almighty.
Abu Ya‘laa narrated a Hadeeth on the authority of Anas reflecting the same meaning, “…so that those who worshipped them would see them” Allaah The Almighty Says (what means): {Indeed, you [disbelievers] and what you worship other than Allah are the firewood of Hell. You will be coming to [enter] it.} [Quran 21:98]
Al-Khattaabi said that the fact of their being in Hell does not mean that they will be tormented, but this is a kind of rebuke for those who used to worship the sun and the moon in the worldly life, so that they would know that being worshiped was wrong. Other scholars said that sun and moon were created from fire so they would be returned to it. Al-Ismaa‘eeli said that putting them in Hell does not necessarily mean that they are being tormented, because there are angels, stones and other things put in Hell as means of torment and punishment, but they themselves are not being tormented.
Ibn Qutaybah said that the sun and moon are not tormented by being in Hell, but they were created out of it so they will be returned to it once more. Their case is the same as that of the stones mentioned in the verse in which Allaah the Almighty Says (what means): {then fear the Fire, whose fuel is men and stones, prepared for the disbelievers.} [Quran 2:24]
Is it logical to wonder what was the sin committed by the stones upon hearing this?
Allaah Knows best.