Energy is not a fundamental property of light. It is a
property of the relationship between the light and the observer.
If the observer is moving toward the light source, the light is seen
to be more energetic, because its observed frequency is higher.
If the observer is moving away from the source, the light is seen
to be less energetic, because its observed frequency is lower.