Overall meaning :
The Almighty says to His Prophet, Muhammad, may Allah bless him and grant him peace, 'Mention to your idolatrous people the time when Abraham disapprovingly said to his father, Azar, an idolater himself, “Do you worship idols besides Allah? I see that you and your people, who also worship idols, are in manifest error and have clearly strayed far away from the right path.'’
Allah then states that just as He guided Abraham to follow the right religion and true monotheism, so, too, He showed him the great kingdom of the heavens and the earth and His amazing handiwork in them and the proofs to use as evidence for Allah’s oneness and His worthiness to be worshipped alone, and to be a firm believer.
When night fell and spread its darkness over him, he saw a planet. 'This is my Lord!’ he said to his adversaries, by way of argument. But when it disappeared he said, 'I do not like objects of worship that change, disappear and leave their worshippers.’ When he saw the moon rising, he said, by way of establishing evidence against his adversaries, 'This is my Lord!’ But when it set, he said, 'If my Lord does not guide me to the truth, I will surely be among those who have strayed from the right path.’
Then, when he saw the sun rising, he said, by way of argument, 'This must be my Lord! It is greater than the planet and the moon.’ But when the sun went down, Abraham said to his people, 'I disown all that you worship with Allah. I declare myself a pure monotheist, devoting myself entirely to the worship of Allah alone, who has created the heavens and the earth, and I am not of those who associate partners with Him.’