How we can explain bending of electromagnetic waves in a different optical media? How can we explain the bending of light when it moves through different optical media by Maxwell's equations treating light as an electromagnetic wave?
 A: This is treated in most advanced EM textbooks.  The bending follows from applying the boundary conditions on the incident, reflected, and refracted wave at the interface of two different media.
A: Maxwell's Equations are only essential to explain why the speed of the wave decreases as it passes to another medium, but the bending itself the wave experiences is only a consequence of this change in speed.
Let me focus on the bending itself first. The best way to qualitatively describe how waves propagate is through Huygens Principle: take a point of your wavefront, assume it creates a spherical wave, propagate the wavelet for a time interval $\Delta t$, repeat the process for all points in your wavefront and add all wavelets to construct the wavefront at time $t + \Delta t$.
In the figure below I drew a wavefront (in dark blue) incident on a medium with $v < c$ at time $t$. Let's use Huygens Principle to see what happens.

Focus on the points $a$ and $b$. By the Principle, each one creates a spherical wave, however $a$'s wavelet travels at speed $c$ while $b$'s wavelet travels at speed $v$ since it is already inside the other medium. Since $v<c$, $b$'s wavelet lags behind $a$'s wavelet. If you repeat this reasoning for all points of the original wavefront, your propagated wavefront at time $t+ \Delta t$ should look something like this:

Notice how part of the wavefront looks bent now. That's all because of how the wave inside the medium is slower than the wave at the original medium. The "bent" would be the other way around (away from the interface's normal) if the speed inside the medium was faster than the incident medium's speed.
Now, why does the speed of EM waves get slower when changing medium? Well, what happens is that the wave's electric field interacts with the dipoles that constitute the medium, forcing them to oscillate with the wave. This oscillation of dipoles radiates more EM waves, but these new waves are such that when you add them to the original wave (which is still travelling at speed $c$) the net result is a wave that looks like the original but with a different propagation speed. Even you if solve Maxwell's Equation part of this explanation gets obscured on how easy it is to describe linear media, but if you delve into the details this is what ends up happening. You can check a detailed explanation of this phenomenon here.
A: Snell's law governs the bending of a light ray as it passes through a boundary separating two media.  In essence, Snell's law (and others) can be derived by requiring that the tangential components of both E and H are continuous across the interface.
My E&M text (Lorrain and Corson, 2nd Ed), says that to obtain this continuity, valid relations must exist between E$_i$, E$_r$ and E$_t$ (incident, reflected and transmitted wave, respectively).
Three conditions are indicated:

*

*All three of these vectors should be identical functions of time - which means they all have the same frequency.  This makes sense because forced vibrations will have the same frequency as the applied force.


*All three vectors are identical functions of position, r$_I$, on the interface.  This condition will give the law of reflection and Snell's law.


*There need to exist conditions between the amplitudes of the three waves.  These will lead to Frensel's equations.
Looking closely at requirement 2 this means that, writing the waves as plane wave: $$\vec{E}=\vec{E_A}\exp{j\omega(t - \frac{\vec{n}\cdot\vec{r}}{u})}$$  then $$\frac{\vec{n_i}\cdot\vec{r_I}}{u_1}=\frac{\vec{n_t}\cdot\vec{r_I}}{u_2}$$ where i and t refer to incident and transmitted and $u_1$ and $u_2$ are the phase velocities of the two media.  From this, requiring the tangential components to be equal means $$\frac{sin\theta_i}{u_1}=\frac{sin\theta_t}{u_2}$$  So this tells us if $u_1$ is not equal to $u_2$ (and this will be true if the index of refraction of the two media are not equal) then $\theta_i$ will not be equal to $\theta_t$ - i.e. the light ray will be bent.
Thus from the simple requirement of continuity of the tangential components of electric and magnetic fields across the boundary, the behavior of the reflected and refracted waves can be derived.
A: The bending of light or to say to derive the snell's law by using maxwell's equation, we can derive this by knowing the boundary conditions of electric and magnetic field on the interface of the vacuum and the  and writing  the boundary conditions on the interface and using them maxwell's equation to get the answer and you have to use the wave equation of electric field as sine or cosine wave and considering it to be falling on the interface at making some angle we can write the boundary condition then you will get the why the bending takes place using Maxwell equation. pure mathematically we can get the bending of light reason but physically if you want to know I can explain you that if you want.
