Solar panels produce direct current electricity – a flow of electrons in one direction. Changing the direction of the flow of electrons will reverse the motor’s spin direction.
This can be an interesting thing when you connect two solar panels to the same motor, but with their test leads reversed. That is, with one panel having a positive lead attached to the same motor pole tab as a second panel’s negative lead. And on the other motor tab, the situation is reversed – so that the first panel’s negative lead shares with the second panel’s positive lead.
The solar panel receiving the most sunlight will be the one that dominates, and the motor will spin in the direction the more sun-lit panel is wired for.
If you place a perpendicular card between two solar panels aimed towards the Sun, with both panels attached to the motor, but with their positive and negative leads reversed, when both receive equal sunlight (pointed directly at the sun) the motor will be still.
If one panel is slightly shaded however, the motor will run in the direction set by the panel receiving the most sunlight, until both panels are receiving equal light again, at which point it will stop.
However, the Earth spins continually, and soon the Eastern-most panel will be shaded again. If the motor is attached to a wheel, and the whole assembly mounted on a turntable, the panels will slowly track the sun all day long. For example, see Mark Mateus’ Solar Home (shown).