These missing sections a the result of atoms between you and the core of the Sun that have absorbed very specific colors of light. To understand why this happens, let us learn a little about how atoms work. We will return to the rainbow of the Sun later.
If one takes a tube filled with, say, hydrogen (or any element or chemical) and runs electricity through it, the tube will glow with a very unique color. Passing this light through a prism (or similar device), you will find that the "rainbow" of the element is composed of discrete and completely unique pattern of colors. This uniqueness of an extremely powerful tool - it is a fingerprint that can be used to identify a particular (any!) element or chemical - hydrogen, helium, lithium, sodium chloride (table salt), carbon dioxide (the stuff you exhale), oxyhemoglobin (the stuff that makes your blood red), chlorophyll (the stuff that makes plant green), methane, amonia, etc.