Main Question or Discussion Point
I have heard that photons are attracted by gravity. Does this apply to electrical or magnetic fields?
Photons are not at rest. They are moving at c and have energy and momentum. Yes, they are massless, but this does not prevent them from having momentum, you just need to use different laws with them, not the laws that govern bodies with mass.Having energy does not imply having momentum, any object in rest has potential energy and zero momentum.
Gravity does not "pull" them. Gravity bends space and the photon continues on a straight path through curved space. Photons are never accelerated, only the frequency is affected, which confirms they have no mass.
In relativistic mechanics, the general relationship between energy, momentum and mass is E2 = (pc)2 + (mc2)2, where m is what some people call "rest mass". (Physicists generally call it simply "mass".) For a photon, m = 0 so E = pc or p = E/c.Okay so how can they have a nonzero momentum?