"...if they are affected by gravity (attracted to matter) when they are fairly stationary?"
Photons are never stationary; however much you confine them, they'll still bounce around at the speed of light. Being massless means travelling at the speed of light; no ifs or buts.
"If you're equating the energy of a photon to an 'effective mass'...then you'd have a situation in which X-ray photons...should be deflected more by gravity."
This argument turns out to be the same as arguing heavier masses experience greater acceleration than lighter ones, which Galileo disproved. Do the full calculations and you'll see the angle of deflection is independent of mass. (And we can check this by looking for chromatic aberration in gravitational lensing which, AFAIK, isn't seen.)
However Bob is right inasmuch as photons do distort space time. If that wasn't the case, ~90% of the mass in a proton wouldn't count for gravity (since only ~10% of the rest mass of a proton is due to the rest mass of its constituent quarks). But the distortion caused by a photon is negligible: we can't even measure the gravitational interaction between protons, and they have a rest mass of ~1GeV.