From the law of refraction, incident ray, refracted ray and normal at surface are lies in one plane.
Now
when light ray enters from rarer to denser medium, it turn towards the normal, and from dencer to rarer it turns away to the normal.
and it is depends upon the refractive index of medium (u).
This reflective index of medium is a relative value which is given by snells law
(u)= sin(i)/sin(r). where (i)&(r) is the angle of incident ray and reflected ray. So denser medium have greater value of (u).
That's why the rarer medium convex lens placed in dancer medium behaves like as concave lens and Concave lens behaves like Convex lens.