Light is an electromagnetic wave whose total energy is the photon’s energy e multiplied by the number of photons n. This leads to constancy of energy inside a cone centered at the source (see Figure 1). So, whatever the distance from the source, a segment of the cone of unit length contains the same quantity of energy. For an electromagnetic wave, if we know the electromagnetic field, we can also calculate its energy in terms of electric and magnetic fields. This is the case for solutions of the electromagnetic wave equation. Contrary to light, these fields give a variable energy that become infinity near the source, violating physical principles.

Please read the article at

http://pengkuanem.blogspot.com/2013/01/energy-density-of-electromagnetic-wave.html

or http://www.academia.edu/2451924/Energy_density_of_electromagnetic_wave