At the time the solar system was forming, the Sun at the center would have been sending heat out through the protoplanetary disk, and regions closer to the Sun would have been much hotter than regions farther away. This gradient in temperature resulted in different materials condensing out of the gas into solid phases at different distances from the Sun. At the earliest times, only materials with very high solidification temperatures, like metals and silicate rocks, could condense out of the gas in the inner solar system. Hence, the terrestrial planets closer to the Sun and in the inner solar system are rocky.