question: Why is it colder at higher altitudes even though it’s closer to the Sun?
comment: Gas in our atmosphere contains the heat we feel. Since gas is more concentrated (and at higher pressure) lower to Earth, since gravity pulls it there, there are more molecules to hold heat closer to the surface. Higher in the atmosphere gas is less concentrated and therefore the temperature is colder.
passages: By analysing the spectrum of the chromosphere, it was found that the temperature of this layer of the solar atmosphere increases with increasing height in the chromosphere itself. The temperature at the top of photosphere is only about 4,400 K, while at the top of chromosphere, some 2,000 km higher, it reaches 25,000 K. This is however the opposite of what we find in the photosphere, where the temperature drops with increasing height.
   At height the temperature reaches its maximum (; stratopause) and then slowly decreases (about ; mesosphere). Causes of this decrease are unclear; it can be related to cooling action of carbon monoxide, hydrogen cyanide or other reasons. Above 200 km temperature reaches approximately and then remains constant.
   Temperatures drop with increasing altitude to the mesopause that marks the top of this middle layer of the atmosphere. It is the coldest place on Earth and has an average temperature around .
   The exact altitude varies by the energy inputs of location, time of day, solar flux, season, etc. and can be between high at a given place and time because of these. A portion of the magnetosphere dips below this layer as well.
   In complete contast the mean temparature on Mars is very cold at -63 deg C [-82 deg F] This is despite having over 95% atmospheric CO2, almost the same as Venus, but at a much lower pressure than both earth an Venus. Mars is further from the Sun than earth but still receives about 44% of the suns heat [approx 500w/msq] when compared to earth. Also any atmospheric or surface heating from solar flares and cosmic radiation affects Mars as it has no magnetic field. 
   BULLET::::- Below, gravity tends to dominate the shape of most features, so that the Sun may often be described in terms of layers and horizontal features (like sunspots); above, dynamic forces dominate the shape of most features, so that the transition region itself is not a well-defined layer at a particular altitude.
  
  BULLET::::- Below, most of the helium is not fully ionized, so that it radiates energy very effectively; above, it becomes fully ionized. This has a profound effect on the equilibrium temperature (see below).
   Section::::Instruments.:Chemical studies.:Microwave Limb Sounder (MLS).
  
  The MLS detected naturally occurring microwave thermal emissions from Earth’s limb to create vertical profiles of atmospheric gases, temperature, pressure and cloud ice. MLS looks 90° from the angle of UARS’ orbit.
   The temperature profile of the atmosphere is a result of an interaction between radiation and convection. Sunlight in the visible spectrum hits the ground and heats it. The ground then heats the air at the surface. If radiation were the only way to transfer heat from the ground to space, the greenhouse effect of gases in the atmosphere would keep the ground at roughly , and the temperature would decay exponentially with height.
   In the Earth's atmosphere, temperature varies greatly at different heights relative to the Earth's surface. The coldest temperatures lie near the mesopause, an area approximately 80 km above the surface. In contrast, some of the warmest temperatures can be found in the thermosphere, which receives strong ionizing radiation at the level of the Van Allen radiation belt.
  
  Temperature varies as one moves vertically upwards from the Earth's surface. It also depends on the change of latitude.
  
  Section::::Temperature range.
   BULLET::::5. Altitude. At a higher altitude it is easier to become burnt, because there is less of the earth's atmosphere to block the sunlight. UV exposure increases about 4% for every 1000 ft (305 m) gain in elevation.
  
  BULLET::::6. Proximity to the equator (latitude). Between the polar and tropical regions, the closer to the equator, the more direct sunlight passes through the atmosphere over the course of a year. For example, the southern United States gets fifty percent more sunlight than the northern United States.
   BULLET::::- The point farthest from Earth's center is the summit of Chimborazo in Ecuador, at from Earth's center; the peak's elevation relative to sea level is . This is because Earth is an oblate spheroid rather than a perfect sphere; it is wider at the Equator and narrower between the poles. Therefore, the summit of Chimborazo, which is near the Equator, is farther away from Earth's center than the summit of Mount Everest is; the latter is closer, at from Earth's center. Peru's Huascarán (at ) contends closely with Chimborazo, the difference in the mountains' heights being just .
   The Sun's radiation is that arriving at the top of the atmosphere (TOA). As can be read from the table, radiation below 400 nm, or ultraviolet, is about 12%, while that above 700 nm, or infrared, starts at about the 49% point and so accounts for 51% of the total. Hence only 37% of the TOA insolation is visible to the human eye. The atmosphere shifts these percentages substantially in favor of visible light as it absorbs most of the ultraviolet and significant amounts of infrared.
  
  Section::::Derivation.
   Interaction with the atmosphere significantly influences temperature of the surface. Calculations show that the atmosphere, despite very low pressure, can significantly diminish diurnal variations of this temperature. But there still remain temperature variations of about  – partly because of cooling of the surface due to sublimation of ices.
  
  Section::::Pressure.
   The temperature of the thermosphere gradually increases with height. Unlike the stratosphere beneath it, wherein a temperature inversion is due to the absorption of radiation by ozone, the inversion in the thermosphere occurs due to the extremely low density of its molecules. The temperature of this layer can rise as high as , though the gas molecules are so far apart that its temperature in the usual sense is not very meaningful. The air is so rarefied that an individual molecule (of oxygen, for example) travels an average of between collisions with other molecules. Although the thermosphere has a high proportion of molecules with high energy, it would not feel hot to a human in direct contact, because its density is too low to conduct a significant amount of energy to or from the skin.
   Because of its temperature, the atmosphere emits infrared radiation. For example, on clear nights Earth's surface cools down faster than on cloudy nights. This is because clouds (HO) are strong absorbers and emitters of infrared radiation. This is also why it becomes colder at night at higher elevations.
  
  The greenhouse effect is directly related to this absorption and emission effect. Some gases in the atmosphere absorb and emit infrared radiation, but do not interact with sunlight in the visible spectrum. Common examples of these are and HO.
  
  Section::::Optical properties.:Refractive index.
   The vertical temperature structure of the Martian atmosphere differs from Earth's atmosphere in many ways. Information about the vertical structure is usually inferred by using the observations from thermal infrared soundings, radio occultation, aerobraking, landers' entry profiles. Mars's atmosphere can be classified into three layers according to the average temperature profile:
   Terrestrial radiation is emitted at much longer wavelengths than solar radiation. This is because Earth is much colder than the sun. Radiation is emitted by Earth across a range of wavelengths, as formalized in Planck's law. The wavelength of maximum energy is around 10 micrometers.
  
  Section::::Cloud physics.
   The Sun's convection zone extends from 0.7 solar radii (500,000 km) to near the surface. In this layer, the solar plasma is not dense enough or hot enough to transfer the heat energy of the interior outward via radiation. Instead, the density of the plasma is low enough to allow convective currents to develop and move the Sun's energy outward towards its surface. Material heated at the tachocline picks up heat and expands, thereby reducing its density and allowing it to rise. As a result, an orderly motion of the mass develops into thermal cells that carry the majority of the heat outward to the Sun's photosphere above. Once the material diffusively and radiatively cools just beneath the photospheric surface, its density increases, and it sinks to the base of the convection zone, where it again picks up heat from the top of the radiative zone and the convective cycle continues. At the photosphere, the temperature has dropped to 5,700 K and the density to only 0.2 g/m (about 1/6,000 the density of air at sea level).
   The inner edge of the HZ is the distance where runaway greenhouse effect vaporize the whole water reservoir and, as a second effect, induce the photodissociation of water vapor and the loss of hydrogen to space. The outer edge of the HZ is the distance from the star where a maximum greenhouse effect fails to keep the surface of the planet above the freezing point, and by condensation.
   Section::::Climate.
  
  Climate in the mountains becomes colder at high elevations, due to an interaction between radiation and convection. Sunlight in the visible spectrum hits the ground and heats it. The ground then heats the air at the surface. If radiation were the only way to transfer heat from the ground to space, the greenhouse effect of gases in the atmosphere would keep the ground at roughly , and the temperature would decay exponentially with height.
   Section::::Geometry of Sun angle.
  
  When sunlight shines on the earth at a lower angle (Sun closer to the horizon), the energy of the sunlight is spread over a larger area, and is therefore weaker than if the Sun is higher overhead and the energy is concentrated on a smaller area.
   "Emission" is the opposite of absorption, it is when an object emits radiation. Objects tend to emit amounts and wavelengths of radiation depending on their "black body" emission curves, therefore hotter objects tend to emit more radiation, with shorter wavelengths. Colder objects emit less radiation, with longer wavelengths. For example, the Sun is approximately , its radiation peaks near 500 nm, and is visible to the human eye. Earth is approximately , so its radiation peaks near 10,000 nm, and is much too long to be visible to humans.
   Above the chromosphere, in a thin (about 200 km) transition region, the temperature rises rapidly from around 20,000 K in the upper chromosphere to coronal temperatures closer to 1,000,000 K. The temperature increase is facilitated by the full ionization of helium in the transition region, which significantly reduces radiative cooling of the plasma. The transition region does not occur at a well-defined altitude. Rather, it forms a kind of nimbus around chromospheric features such as spicules and filaments, and is in constant, chaotic motion. The transition region is not easily visible from Earth's surface, but is readily observable from space by instruments sensitive to the extreme ultraviolet portion of the spectrum.
   The ELR is nothing more than the difference in temperature between the surface and the tropopause divided by the height. The ELR assumes that the air is perfectly still, i.e. that there is no mixing of the layers of air from vertical convection, nor winds that would create turbulence and hence mixing of the layers of air. The reason for this temperature difference is that the ground absorbs most of the sun's energy, which then heats the lower levels of the atmosphere with which it is in contact. Meanwhile, the radiation of heat at the top of the atmosphere results in the cooling of that part of the atmosphere.
   Section::::Temperature.
  
  Within the mesosphere, temperature decreases with increasing height, due to decreasing absorption of solar radiation by the rarefied atmosphere and increasing cooling by CO radiative emission. The top of the mesosphere, called the mesopause, is the coldest part of Earth's atmosphere. Temperatures in the upper mesosphere fall as low as , varying according to latitude and season.
  
  Section::::Dynamic features.
  
raw_presuppositions: Higher altitudes should be hotter because they are closer to the sun. 
raw_corrections: High altitudes are not warmer because the gas that makes them warm is pulled down by gravity. 