The Quran says that the Sun has a setting place and a rising place on the Earth. Listen to Quran 18:86 -
Word by word grammar: http://corpus.quran.com/wordbyword.jsp?chapter=18&verse=86
Pickthall: Till, when he reached the setting-place of the sun, he found it setting in a muddy spring, and found a people thereabout. We said: O Dhu'l-Qarneyn! Either punish or show them kindness.
Pickthall gives the correct translation of this verse. Some others have tried to twist the words to make it seem like "he reached the setting of the sun" instead of the correct translation "he reached the setting place of the sun"...
I will clearly explain how. Please refer to the word by word grammar of the quran i linked above as you follow my explanation.
The verse 18:86 in arabic: "Hatta idha balagha maghriba al-shamsi wajadaha taghrubu fi aynin hamiyatin wawajada indaha qawman. Qulna yadha al-qarnayni! Imma antu adhiba wa imma an tattakhidha fihim husnan."
Lets look at this part by part: The verses before 18:86 tells that he (Dhulqarnayn) followed a way... Now 18:86 - "hatta idha" meaning "until when"...
"balagha" means "he reached"
"maghriba al-shamsi"... this is where the translators are causing confusion. This actually can mean "setting place of the sun" or "time of sunset".... but it is very clear from the context that here, it means "setting place of the sun". Dont believe? Try putting the other meaning here. It reads - "He followed a way until when he reached the time of sunset".... This is absurd. Why would anyone say "he reached the time of sunset"?
If that was what allah wanted to tell us, he could have simply said "he followed a way until the sun set". Why the use of the word "balagha" (he reached)? Because he actually meant "he reached the place of sunset". Its clear....
There is no use trying to mistranslate it as "he reached the place at the time of sunset" etc... because that requires insertion of new words absent in the quran.
Now some people also try to translate maghriba as "west" or "far west". While it is true that maghrib can also mean "west", the words "maghriba al-shamsi" would then translate to "west of the sun" which is another clear absurdity. When maghrib is used along with "al-shamsi", that means the setting place (or time) of the sun.
Infact, the Quran repeats a similar mistake in verse 18:90 (http://corpus.quran.com/translation.jsp?chapter=18&verse=90) -
Till, when he reached the rising-place of the sun, he found it rising on a people for whom We had appointed no shelter therefrom.
Word by word grammar: http://corpus.quran.com/wordbyword.jsp?chapter=18&verse=90#(18:90:1)
The Arabic words used are "Matliaa al-shamsi" which invariably means "Rising place of the sun" (again it is a place, not time because Dhul Qarnayn is said to have reached there). Why? Because Matlaa cannot be translated as "east". East is always referred to as Mashriq in the Quran.
In this context, the meaning "time of sunrise" for "matliaa al-shamsi" can be ruled out as I explained above.
Another defense by Muslim apologetics is - "Where does it say that the setting place of the sun is on the earth?" The answer is simple. It says that Dhul-Qarnayn followed a way until he reached the setting place of the sun. If the author of quran knew that sun does not have a setting place on the earth, then why would he say that Dhul-Qarnayn reached that place? Similarly, the Quran states that he reached the place of sunrise.
So it is clear, the Quran says that sun has a setting place on the earth - More specifically, a muddy spring. Also, it says that the sun has a rising place on the earth.
Now people like Zakir Naik have also tried mistranslating the latter part of the verse as "it appeared to Dhulqarnayn" that sun set in a muddy spring. He claims that meaning of Wajada is "appeared to".... but the actual meaning is "found"... meaning he found the sun setting in a muddy spring. Want further proof? See the same word "wajada" used in the latter part of the verse.... if Zakir is correct, it would be like this - "It appeared to Dhul-Qarnayn that there were people at the place".... this is nonsense.. this nonsense is due to Zakir's mistranslation of the word "Wajada". Wajada means found.
And here is the final blow - Muddy springs are too small to cause the illusion of sun setting in them. So, to say that "it appeared to him that sun set in a muddy spring" is highly improbable. It would take the sea or atleast a very large lake for this illusion to happen. Even if it did appear to someone that the sun is hitting the horizon on the surface of a muddy spring, all the person needs to do is to take a few steps forwards or sideways and then the land, trees or hills on the other side of the spring would be easily visible to him.
Just take a look at a typical muddy spring...