How does the temperature of the earth's surface affect the temperature of the air above it?
The Earth's surface is actually what heats the air above it.
The energy from the sun is "short-wave", and as such air is transparent to it. The sunlight goes right through the air without heating it at all. This "short-wave" radiation is absorbed by the Earth which then heats up. The heated Earth then emits it's own radiation but it is in the infrared part of the spectrum or "long-wave" radiation. This heat is what warms the atmosphere.