e = mc^2 is Einstein's famous equation relating mass and energy. It's one of the most famous equations in science, and seems straightforward enough: a little bit of mass translates into a lot of energy, powering technologies like nuclear reactors.
What, however, about light? According to e = mc^2, light has 0 energy. None. Does this make sense? When we stand under a light, we get hot. Plants use sunlight to grow. A solar-powered car uses energy from light to move. Clearly, light has energy.
How can this be? The answer is that e = mc^2 isn't the entire equation. The full equation exists in a form similar to the Pythagorean Theorem: (e)^2 = (mc^2)^2 + (pc)^2. The component pc is related to an object's momentum, and how close it is to the speed of light. As objects move faster, their speed is energy in and of itself.
Frequently, this doesn't matter in real world physics, and is hence excluded. With the exception of electromagnetic waves, it is extremely difficult to approach even a fraction of the speed of light. On an atomic scale, the mass of objects we work with is so huge that the energy margin of error from treating the momentum as 0 is insignificant- it's small to the degree that computers need extremely proprietary programming (or even hardware) just to track it.
How, then, do we determine the energy contained in light? Let's return to the accelerating solar car from earlier.
We'll assume the total mass of the car is 300Kg. We'll also assume perfect energy transfer (for now), that is, no energy is lost to heat or elsewhere.
Calculating the energy of sunlight using wavelengths is impractical, because the sun emits light across a spectrum. Instead, we'll use the Solar Constant, approximately 1370 Watts/m^2, and assume the car's solar panel has an area of 0.5m^2.
From this, we can assume the solar panel is generating 685 Watts. As 1 Watt = 1 Joule / 1 Second, over a 60-second period of time the panel will output 41100 Joules of energy.
Since we know the mass of the car to be 300Kg, the kinetic energy is thus (41100) = 0.5 * (300) * v^2. Solving for v gives sqrt(274)m/s, or approximately 16.55m/s or 37 mph.
Using v = vi + at, we can find that the acceleration over this one-minute interval (starting from rest) is 0.275m/s^2. Thus, the net force, using f = ma, is 82.65N.
Obviously, perfect energy transfer is not guaranteed. Friction against the road, friction and inefficiencies within the car's engine and gears, and inefficiencies in the solar panel would lower the output significantly.
Most commercial solar panels range from 10% to 20% efficiency, with anything over 40% being extremely rare (we're assuming 100%).
In conclusion, the energy of light comes from its extremely high speed, regardless of the fact that it has no mass.