Method for measuring the refractive index of transparent solids