What happens when a ray of light moving from a denser to a rarer medium is incident at the interface at the critical angle?

If the light ray is normal to the surface, the maximum amount of light is transmitted.

As the light ray bends, as in your part (b), a percentage of the light will be transmitted (refracted) and the remaining will be reflected (at the incidence angle).

Very near the critical angle $\theta_c - d\theta$, likewise, some of the light will be transmitted (refracted almost tangent to the surface) and some will be reflected. At this point you can imagine the majority of the light would be reflected and only a small percentage of light is refracted.

At the critical angle $\theta_c$, although the refracted angle is tangent to the surface, the intensity is actually 0, and all the light is being reflected.

Past the critical angle $\theta_c + d\theta$, all the light is reflected.

Likewise, in the reverse case, because the optical density of the medium is reversed, there is no $\theta_c$. At $\theta < \frac\pi2$ some of the light gets transmitted(refracted) and some gets reflected. At $\theta = \frac\pi2$ all the light gets reflected at the angle $\frac\pi2$ so the resulting conclusion is that the light simply goes in a straight line.