Light follows a curved path in a medium with continuously changing density.
Light changes its path as the medium changes during the transit. This is because of