The Gemara in Bava Basra 25 has a discussion between Rebbe Eliezer and Rebbi Yehoshua. Rebbe Eliezer says that the world is like an excedra, a three-walled front veranda, that is open on the north. Rebbi Eliezer explains that the sun surrounds us from the east, through the south, until the west. But it does not travel in the north. Instead, at night the sun doubles back and goes into the sky.
Rebbi Yehoshua on the other hand says that the world is surrounded completely as a domed tent. At night, the sun goes out in the north around the wall and back around to the east. This, says Rebbi Yehoshua, is reflected in the verse (Koheles 1.9) 'Goes to the south; circulates to the north'.
This passage does seem strange, especially to the modern ear. This has been pointed to as an indication that the Tanna'im believed in a flat earth.
However, anyone taking a harder look should realize that there is something very wrong with taking this whole thing at face value. Is it possible that the whole world watches the sun going down and these rabbis, scientists or not, announce that the sun is on its way up?
Moreover, Rebbi Eliezer, who held the stranger view -- that the sun rolls back into the sky -- is most famous for not saying anything he didn't learn from his teachers. These are obviously not musings of Sun observers, but rather some depiction of a different take on this planet's lighting.
We often find that great meaning is attributed to the concept of light. Light and darkness are part of a theme that transcends the plane of matter. In fact it can be said the other way around: the original, metaphysical concept named light and darkness, was manifested into this world as the light and dark that we know.
For this reason we find statements attributing the eclipses to certain base sins. These aren't scientific causes, nor are they direct causes. But the Maharal explains, the realm of the physical world allows for such sins and therefore it receives its light source in this matter. In other words, it isn't the specific act of a sin that caused the eclipse to happen, but rather a world in which such behavior is possible is not compatible with never-ending light. There would have to be a flaw in the light source to reflect the fact that this light is not completely in line with its namesake.
Back to our discussion, Rebbe Eliezer and Rebbe Yehoshua are discussing how we are to perceive our light source during the absence of light. According to both of them we don't simply view the sun as having gone below the horizon. Something more momentous is happening when the sun is disappearing from us.
Rebbe Eliezer says that we don't perceive the sun as being under the earth but rather as having gone far away from us, further into the sky. It is somewhere in the sky but not in our hemisphere, so it is said to have gone higher up and above. Rebbe Yehoshua says that we shouldn't say that the sun is completely beyond, since we do anticipate its return the next morning. Instead we view it as having gone behind a wall; it is away from our view but within our realm.
In truth, although the sun appears to be in the south at noon and head north while going west, to those at the equator the sun doesn't change its latitude during the day. The reason we see it as moving south and north is because our sense of north is not parallel to that north of the planet. Therefore, as the sun moves through the day it is changing latitude only in respect to our hemisphere latitude lines.
This being the case, it is not a stretch to speak of the sun as not going in the north at night, since in truth it never changes latitude but only to our eyes. When we don't see the sun why should we continue to give it a relative position?
And it is true, and obvious, that the sun is not under the earth at any point but rather due to the rotation we are too far and around the bend. So in fact, while in a flat earth picture Rebbe Eliezer's statement would be counter intuitive and contrary to the obvious, in a system as we have now it would be hard to argue with the notion that the sun is further out in space rather than being under the earth.
And Rebbe Yehoshua merely argues this point to say that although indeed the sun is not under the earth but rather out in the open sky, we shouldn't describe this as being too far but rather as behind the wall.
The motivation for this argument seems to be about the general concept of darkness. Rebbe Eliezer would say it is due to the light having been retracted to its origins, but Rebbe Yehoshua would say the light is still here but it is momentarily being blocked.