In the second medium, the speed is different, equal to the radius of the blue circle. The geometrical construction drawn constructs the outgoing direction such that Snell's law is satisfied.
That law is usually expressed as: the ratios of the sine of the angle of the incident ray and the sine of the refracted ray is the ratio of the speeds of light in those media.
You can change the speed of light in both media (by changing the radii), the angle of the incident ray, and the boundary surface. The construction should be clear when you play with it -- although you may need to prove to yourself that this is Snell's law in action!
Created with Cinderella