To understand the relationship between refractive index and the atomic or molecular structure of a material it is necessary to remember that light is electromagnetic wave propagation characterized by oscillating electric and magnetic fields in perpendicular directions, both of which are perpendicular to the direction of propagation of light. The speed of light propagation is 2.9979x10^8 m/s in vacuum.
The light can be treated as a varying electric field. If a static field is applied to an insulating material, the internal components which carry a charge will try to line up with the field and the material is said to become polarized. The most important of the charge internal components are (i) the permanent molecular dipoles present; (ii) the positive and negative ions present; and (iii) the electron present. In a static electric field existing molecular dipoles will reorient themselves in the field as much as the surrounding allow, illustrated in Fig (a). In the case of ionic solids the overall dipole moment is zero in the absence of an electric field. In a static electric field the ions move slightly so as to produce an net dipole moment, illustrated in Fig (b). The lightest component, the negative charged electron cloud surrounding the atomic nucleus is easily deformed by an external field to create a dipole, as sketched in Fig (c). If the electric field is not static, but consists of an alternating field, the dipoles, ions and electrons will try to follow the changes in the field direction and move to and fro.
The electron can follow oscillations of a varying electric field even at visible and UV. And it is these which are most important in color production. This response of the electrons to an applied alternating electric field is called the electronic polarizability.