There are mainly two factors on the basis of which we can check the existence of the atmosphere on the surface of a planet.
1) Temperature present on the surface of a planet. We know that the temperature of a planet depends upon the speed of the gas molecules.
2) Acceleration due to gravity
Surface Temperature (Speed of gas molecules): The formula to calculate the speed of the gas molecules on the surface of a planet is given by:
The above equation is also known as Boltzmann’s equation. Where k is the Boltzmann’s Constant. The value of k is 1.37 X 10-23 J molecule-1 K-1. The temperature of the planet is denoted by T in the equation and m shows the mass of the each molecule.
As the temperature over the surface of the planet increases then as a result the average speed of the molecules also increases. Sometimes the increase in speed of molecules becomes so higher that it crosses the escape velocity of the planet. So, due to their higher speeds than the escape velocity of the planet, the molecules will leave the surface of the planet, leaving behind the planet having no atmosphere.
The temperature on mercury is very high and due to this the gas molecules have higher velocities than that of the escape velocity of earth. So, one by one all the molecules leave the surface of mercury. Hence there is no atmosphere present on the planet mercury. Other planets like mars and Venus have controlled amount of carbon dioxide. But the atmospheres of the other planets consists of light gases such as NH3, CH4, H2, etc.
If we think of sun, its escape velocity is extremely high (618 Kms-1. So, not even a single gas can escape from its surface.