Anna Brettell, of Rangi Ruru School, asks :-
Why are some planets made of gas and some solid?
Alan Gilmore, an astronomer at the University of Canterbury's Mt John Observatory, responded.
The answer goes back to the origins of the solar system. Most of the stuff that made the solar system went into the sun. It was mostly hydrogen and helium with small traces of all the other chemical elements. A small fraction (about one-thousandth) didn't get gathered into the sun. It was left circling the sun in a thick disk.
At first the gas in the disk was very hot, particularly near the sun. Only some metals and minerals condensed into dust at the high temperature. Gradually the dust close to the sun gathered together and formed the small rocky inner planets: Mercury to Mars.
The heat drove the gases and vapours outward to the cooler regions. There dust and ice also gathered together into small planets. As soon as they were big enough, about Earth size, these solid planets began attracting the plentiful gas. Soon the solid core was surrounded with a great depth of hydrogen, helium and other gasses.
So that is why we have small rocky planets close to the sun and big gassy planets far from the sun. As the inner planets cooled down, comets from the cold region brought ice and frozen gases to make their atmospheres and the oceans.