How can a refractometer be used to identify gemstones?

All materials have a specific refractive index ($n$). For common glass this is in the neighbourhood of 1.5, special glass can have an $n$ up to 1.9. Diamond is around 2.4.
By comparing the $n$ of the material with the $n$ of known gemstones, they can be identified or excluded.