Light travels at a speed of 3x108meters / second in a vacuum (such as outer space). This is technically the fastest known speed in the universe. When the speed of light travels in mediums other than in a vacuum, it technically travels a bit slower than that. Consequently, a light ray will bend when travelling from one medium to another. (Did you ever look at your feet while standing in waist deep water? This accounts for the illusion that your legs and feet that are underwater are misplaced with the rest of your body because the light bends as it travels from one medium (air) to another (water) that is in this case causing it to travel slower).The optical density (or more commonly called the index of refraction (n)) of a medium is the ratio of the speed of light in a vacuum with the speed of light in that medium. For example with water, the speed of light in water is roughly 2.25x108meters/second and therefore, the index of refraction in water is:
n =3x108 / 2.25x108 = 1.33
The various indices of refraction of different mediums mostly fall between 1 and 2 (and because it is a ratio of similar quantities, there are no units attached with the answer).
This is different than the mass density of a material which refers to what is more commonly referred to as just the "density" of a material. This density is none other than just the ratio of the mass of a material to its volume or on the planet earth, the wieght of the material per unit volume. For water, as an example, factors such as temperature and phase change may enter into changing water's density slightly but it is technically said to be = 1000 kg/m3 or 1 g/cm3 this is a working value and it is actually chemically a bit less than this to be precise, but, in common terms is said to be this. hope this answer helps.