There are two explanations for these passages in the Christian Scriptures:
Joshua 10:13
So the sun stood still, and the moon stopped
2 Kings 20:9-11
9 Isaiah answered, “This is the LORD’s sign to you that the LORD will do what he has promised: Shall the shadow go forward ten steps, or shall it go back ten steps?”
10 “It is a simple matter for the shadow to go forward ten steps,” said Hezekiah. “Rather, have it go back ten steps.”
11 Then the prophet Isaiah called upon the LORD, and the LORD made the shadow go back the ten steps it had gone down on the stairway of Ahaz.
The best explanation is given by Barry Setterfield: Long Day
About 10 years ago, in a store in Blackwood, South Australia, there was a sophisticated gyroscopic toy for sale. The toy consisted of a central gyroscope suspended by circular loops of metal that were able to move freely in any direction. Idly, I set the toy spinning, then shortly after I gave it a push, corresponding to an “impact” . The gyroscope heeled over, and then in that new position started oscillating. I was amazed at what happened next. At specific points in the series of oscillations, the whole gyroscopic device underwent a figure-of-eight roll and then returned to the oscillating behaviour it had exhibited before.
Let’s look at this. Dodwell had determined the axis tilt curve from the 2345 BC impact. He had also determined the oscillation curve from the data. That curve potentially suggests that at certain key dates a change in oscillation direction will occur. Those dates roughly correspond with Joshua’s long day, Hezekiah’s sundial event, events at the time of the Crucifixion, and others. At the corresponding times, the gyroscopic toy underwent a figure of eight roll. It is possible that the earth may have behaved similarly, or at least in such a way that the objects in the heavens traced an S-shaped path in the sky. This would have a variety of effects depending where on earth the observer was when it occurred. Thus for Joshua the sun and moon remained visible in the heavens while the S-shaped path was followed. At the time of the Crucifixion, “the sun went down at noon” as Amos indicated, and then returned to resume its normal motion. There is also a reference in Job to this effect. Job was writing as an eye-witness to events in his own day. In Job 9:7 he states that God “commands the sun and it rises not”” . This is referring to the results of a similar axis tilt change due to massive impacts at the time of Peleg “when the continents were divided” (Gen. 10:25). This impact was the one that gave the earth’s axis its high tilt that resulted in the ice-age as well as drifting continents. The motion of the earth’s axis after that event in 3005 BC was similar to that from the 2345 BC event. Job was writing about 2800 BC.
This is a good explanation. I hope you all are aware of the really bad explantion which was a hoax about NASA research, an account of which was at Talk Origins.