When the atmosphere contain larger amount of matter which absorbs and emits terrestrial radiation (greenhouse gases), temperature at or near the surface is higher. On the other hand, temperature in the stratosphere is lower (See Manabe 1985, Masuda and Tanabe 1994).
The most important greenhouse gas in the earth's atmosphere is water vapor. It can be supplied by evaporation from the ocean, and therefore the amount tend to be larger when temperature is higher. Thus, the greenhouse effect of water vapor acts as a positive feedback to surface temperature.
The next important is carbon dioxide.
The concentration of carbon dioxide in the atmosphere varies in the annual cycle. It is explained mainly by the annual variation of photosynthetic activity of plants.
In the time scale of million years or more, carbon dioxide is supplied from the earth's interior by volcanic activity and consumed mainly by weathering of rock. In the history of earth, volcanic activity tend to coincide with warm climate. Therefore it is considered that greenhouse effect of carbon dioxide is an important factor of climatic variation at this time scale.
From chemical analysis of air bubbles in ice cores, it is found that atmospheric carbon dioxide concentration varies at the time scales of ten thousand to hundred thousand years as well. It is certain that this variation of CO2 affects temperature, but it is still uncertain whether this variation is the result of variation of temperature as well. In order to explain the cause of this variation, we probably need to consider variations of photosynthetic activity of plants (probably in the ocean) and that of burial rate of organic matter.