The air above Earths surface is at different temperatures. What is responsible for this difference in temperature?

The moon
The sun
Earths rotation