One of the earliest theories for the formation of the planets was called the encounter hypothesis. In this scenario, a rogue star passes close to the Sun about 5 billion years ago. Material, in the form of hot gas, is tidally stripped from the Sun and the rogue star. This material fragments into smaller lumps which form the planets. This hypothesis has the advantage of explaining why the planets all revolve in the same direction (from the encounter geometry) and also provides an explanation for why the inner worlds are denser than the outer worlds.