Why is the air at high altitude colder?
I mean, in a typical small-scale case, hot air rises to the top. If it's hot below and cold above, convection should turn all the air upside down real quick, so it's extremely hard to keep such an upside-down state. So why does it happen in nature?
Sunlight is absorbed mostly by ground / sea, that is where the air is heated; the air high above radiates its heat into space, as infrared radiation. So, temperature gradient buildup is to be expected.
But why is it not equilibrated by convection? That is because of pressure. If you take a bunch of air and pull it up into the stratosphere, it will have to expand to match with lowering pressure around it, and thus get cooler. So, convection won't start before that adiabatic temperature change is overcome. Or if that adiabatic temperature change is reduced by condensing moisture - then, a thunderstorm is likely to form.
So, we could use that temperature difference to generate power. As a byproduct, we heat the stratosphere, which will then radiate more heat into space, eventually cooling our Earth =)