Mass density is the mass per unit volume of a substance. However, optical density is the measure of how fast light travels through a medium. If the speed of light is less in a medium, it is optically denser. It is possible that mass density of an optically denser medium may be less than that of an optically rarer medium. For example, turpentine and water. The mass density of turpentine is less than that of water but its optical density is higher.