What happens to light ray moving from one transparent medium to other at the angle of incidence $90^{\circ}$? I think when a light ray moves from one transparent medium towards other at $90^{\circ}$ incidence angle,it will not suffer refraction but continue to move indefinitely in the initial medium. But, if we take the initial medium as air and the other medium as glass slab, the lateral displacement value in the above case is zero. However, it is given in my book that lateral displacement increases with increase in angle of incidence. This must imply that  at $90^{\circ}$ incident angle, the lateral displacement must be maximum. This contradicts my previous argument. So,How to deal with this $90^{\circ}$ case?
Note:I am a tenth grader and thus,need a more simple argument.Also,when will be the lateral displacement maximum if we change only the angle of incidence and keep the remaining conditions constant?
From @joseph h's answer I got a formula for finding lateral displacement. Can someone give me the derivation to it?
 A: Lateral displacement is observed when a ray of light gets refracted twice as it  passes  from air into a flat glass slab and then exits from the parallel side of the slab into air on the other side.
So that you and other readers can visualize this, consider the following diagram:

The lateral displacement then, is given by the distance $\bf XY$. Furthermore, if
the slab has a thickness $t$, and the angle of incidence of the ray is $i$ with the angle of the first refracted ray $r$ away from the normal inside the prism, then we can derive the equation
$${\bf XY} = \frac{t}{\cos(r)}\sin(i-r)$$ for the lateral displacement.
In the case where the angle of incidence is $i=0^\circ$ (then $r\approx 0^\circ$ and $sin(0)=0$), mathematically the value for $\bf XY$ is zero and geometrically, we can see that it is zero (you may now be seeing where your error was).
We can also see that as the angle of incidence increases, then so to does the value of the lateral displacement$^1$ but up to the critical angle beyond which there will be no transmission of the ray, but instead total internal reflection. Mathematically, we can also see this is true, since being an unphysical result, the denominator diverges because we are diving by $cos(r)\rightarrow 0$ in the limit $r\rightarrow 90^\circ$. All of this is consistent with your book so far.
Now you have stated that when the angle the incident ray enters is at  $90^\circ$ there is no refraction and the ray will pass through. And then you have also stated that if the incidence angle increases then the lateral displacement increases.
The second part of this is true but in the first part, you have assumed that light coming in perpendicular to the surface, is the same as a $90^\circ$ angle of incidence. This is not the case and all you need to do is look at the diagram above to confirm this.
So a ray coming in perpendicular to the top surface does not correspond to an angle of incidence $i=90^\circ$. It actually corresponds to an angle of incidence $i=0^\circ$.
$^1$Note that in the limit $i\rightarrow 90$ then $r\rightarrow 90$ and so $sin(0)=0$ meaning $\bf XY=0$ which is not an actual physically possible result  and this makes sense if we consider that at some point of increasing $i$ there will be no refraction but total internal reflection as mentioned above. A $90^\circ$ incidence angle is not physically meaningful.
Using Snell's law, one can calculate the angle $i$ (termed the critical angle) beyond which there is no more refraction and only reflection. That is $$\theta_{\text critical}=sin^{-1}(\frac{n_a}{n_g})$$ where $n_g$, $n_a$ are the refractive indices for glass and air respectively, and usually this value $\theta_{\text critical}\approx 40^{\circ}$ using the standard values for air and glass refractive indices.
