When light travels from medium C to medium D, the angle of incidence exceeds the angle of refraction, indicating that medium C has a higher index of refraction than medium D. According to Snell's law, the medium with the lower index of refraction allows light to travel faster. Therefore, medium D must have the lower index of refraction. The discussion emphasizes understanding the principles of refraction rather than simply providing answers. This highlights the importance of grasping the underlying concepts in optics.