Because of the Earths atmosphere, the distance from the Sun, does not affect the temperature on the surface of the Earth. In the northern hemisphere, we are closer to the Sun in winter and the furthest away in summer.
Troposphere. This is the lowest section of the earths atmosphere that contains 75% of the earths atmosphere by mass and 99% of the earths water vapour. This section of the atmosphere starts at the surface and extends 7-20km up, the thickness depending largely on where you are in the world.
Early volcanoes discharged different combinations of gases into the Earth's atmosphere creating rain, which cooled the planet and formed solid land masses, and every other element discovered presently.