Deriving photon energy equation using and de Broglie wavelength
So I was learning de Broglie wavelength today in my physics class, and I started playing around with it. I wondered if it was possible to calculate the energy of a light wave given its wavelength and speed. After rearranging a bit, I plugged it into , and realized I had found the equation for the energy of a photon that I learned at the beginning of my quantum mechanics unit,
I have a few questions about this. Firstly, I do not understand how it can make sense to do in this context, because, as I understand it, light has no mass. How can I come to using the mass of a massless object?
Secondly, as I was doing those steps, I thought I would be calculating the energy of the entire light ray. I now realize I was finding the energy of a single photon. In hindsight, this makes sense, because the energy of the entire light ray must depend on some length value, correct?
This led me to two other questions: do light rays have some finite length? how do I calculate the energy of a light ray, not just a single photon?