The lines thus serve as fingerprints for atoms. To understand why this is true, we discuss the structure of atoms. 10 -15 of the volume of the atom.
Atoms are mostly empty space.
If we make an analogy with the Solar System , we can imagine that the nucleus is the Sun, and the electrons are the planets. The electrical force plays the role of gravity. This analogy is useful, however, there are important differences between how our Solar System works and how an atom works. In our Solar System, the planets can, in principle, move about the Sun in orbits of any size. In an atom, the electrons cannot orbit about the the nucleus in any old orbit.