The optical density of a medium is not the same as its physical density. The physical density of a material refers to the mass/volume ratio. Optical density determines how much a light wave is slowed down as it passes through a medium. The more optically dense a material is, the slower that a wave will move through the material.
The refractive index is a measurement of optical density. A medium with a low optical density, would have also a low refractive index.
For example air, having a low optical density has a refractive index of 1.0003, whereas water, with a higher optical density, has a higher refractive index of 1.333.