Does light loses its energy when it passes through denser medium? I know it does not because it emerges out of denser medium at 300,000 KM per second, but according to $E=mc^2$ and given that speed of light decreases inside denser medium with refractive index greater than 1, does not it suggest that energy of light inside denser medium is less?
 A: To a first approximation, the light is still travelling at the speed of light inside of the medium.  There is an apparent slowdown because, as the light ray interacts with the molecules of the medium, it diffracts, causing it to change direction randomly.  This then causes its travel length to increase, which makes the speed appear to be smaller, from a macroscopic perspective.  
The velocity of the light's travel does not decrease, however.
I would also state that $E=mc^{2}$ is not a valid formula for light, as that formula is only valid for stationary objects.  The appropriate version of this for light would be $E^{2} = c^{2}|{\vec p}|^{2}$, and you could answer your above question by also making an appeal to conservation of momentum.
A: To touch on and finalise Jerry Schirmer's answer: the "light" in a medium is not only "light" in the ordinary, vacuum sense of the word, it is a quantum superpositon of free photons and excited matter states. A photon travelling though a medium is repeatedly undergoes the following cycle: it is fleetingly absorbed by electrons in the medium, which re-emit a new photon in its place a fantastically short time afterwards (femtoseconds or less). The process is somewhat like fluorescence, aside from that energy, momentum and angular momentum are wholly transferred to the new photon, whereas in fluorescence, energy (as betokened by the Stokes shift), momentum and angular momentum (as betokened by direction and polarisation shifts) are all transferred to the medium. The delay arising from the absorption / re-emission is what makes the light seem to propagate slowly, but you can see that no energy is lost. A slight variation on this theme is the birefringent material, where energy and momentum are wholly returned to the re-emitted photon, but some angular momentum is exchanged and light thus exerts a torque on a birefringent medium: see the second and third sections of my answer here and indeed there is a classic experiment demonstrating light's angular momentum by R. Beth, "Mechanical Detection and Measurement of the Angular Momentum of Light", Phys. Rev. 50 1936 pp115-127. But energy can still in principle conserved: in practice some mediums have attenuations, but some are fantastically small, for example, silica in the optical telecommunications window between $1350nm$ and $1550nm$ and, for the purposes of this argument, attenuations can in principle be nought.
Witness here is that the Poynting vector in the medium is the same as its freespace value: $\vec{S} = \vec{E}\wedge \vec{H}$, whereas the energy density $U = \frac{1}{2}\vec{D}\cdot\vec{E} + \frac{1}{2} \vec{B}\cdot\vec{H}$ in the medium is now higher: this is simply analogous to the steady state behaviour of a water tank with inlet and outlet pipe: transiently the water output rate can be less than that at the input whilst the tank fills up, but at steady state the two rates must balance. Likewise for the medium: the higher energy densities represent increased energy stores in the matter of the medium owing to the excited matter state parts of the total quantum superposition (there are also reflected energies at the medium's input and output which must be accounted for in an exact descripition, but the essential gist of this paragraph does not change).
A: $E=mc^2$ is not really applicable to light. It is applicable to something that has mass.
The energy of light is given by $E=h\nu$ where $\nu$ is the frequency of light and $h$ is Planck's constant, which has a value of $\approx 6.626 \times 10^{-34} J.s$
When light enters a different medium, its frequency remains the same, and of course, so does Planck's constant. Hence, obviously, its energy remains the same throughout the entire exercise.
A: $E=h \nu$, hence $E$ is proportional to $\nu$,
and $\nu$ does not change when light moves from rare to denser medium. So, it does not effect $E$.
A: Speed of light is a function. When light traverses through a non-vacuum medium, its speed decreases compare to its speed in vacuum. (That is why, index of refraction, n, as a ratio of speed of light in vacuum per speed of light in non-vacuum, increases). 
It means, perhaps, the decreasing of speed of light when light traverses through non-vacuum medium contributes to loss of energy, where energy can be expressed as E = h c/\lambda.
CMIIW. Thank you.
A: A light wave consists of many photons that give its amplitude. While the frequency of the light stays the same the number of photons or waves amplitude may change if there’s absorption. 
Every real substance absorbs and scatters even the transparent. But statistically the frequency is same.
The way you asked the question implies that you ask if the frequency can change. If you consider scattering I.e. the Compton effect yes it is possible to change even the frequency and this is the quantum nature of light. Here we are considering single events.
