Why can't light escape a blackhole? Gravity attracts objects which have mass right. We know that light is massless so why does a black hole's gravity attract light?
 A: light is supposed to possess relativistic moving mass even though it does not possess any rest mass.
  m2c2=M2c2-M2v2  where m is rest mass and M is relativistic mass and v=c. this gives m = 0 , but M is not zero the value of M can be calculated from the experimental data on radiation pressure.
A: A photon has a rest mass of nought (where the rest mass $m$ is the Lorentz-invariant quantity in the four-momentum's Minkowski norm squared $E^2/c^2 - p^2 = m^2 c^2$). 
However, a lightfield of energy $E$ gravitates and itself has a gravitational source equivalent to a mass $E/c^2$. Also, a system of photons has a nonzero rest mass (see reference), as does a photon confined in a perfect resonator (the latter will add to the impulse needed to accelerate the resonator) as I discuss in my answer here
Reference: This was the second paper by Einstein himself on the subject of special relativity, and it is still one of the simplest explanations around of the nonzero rest mass of a system of photons, or, as he conceived it, a pair of Maxwellian light beams:
A. Einstein, "Ist die Trägheit eines Körpers von seinem Energieinhalt abhängig?", Ann. der Phys. 18:639,1905
English translation "Does the Inertia of a Body Depend upon its Energy-Content?" is here
A: We know that light is massless so why does a black hole's gravity attract light?
Because gravity doesn't just attract objects with mass. It alters the path of light too. Because gravity is caused by a concentration of energy which "conditions" the surrounding space, altering its metrical properties, whereupon we talk about spacetime curvature. But note that light doesn't curve because spacetime is curved. Spacetime curvature is actually associated with the tidal force, while the associated spacetime "tilt" is associated with the force of gravity. The latter is the first derivative of potential, the former is the second derivative of potential, to do with Riemann curvature. Have a look at the plot of gravitational potential on Wikipedia. The curvature you can see on the plot is effectively spacetime curvature. But the force of gravity, and thus the curvature of light at some location relates to the slope of the plot. Note though that you need the curvature to get your plot off the flat and level in the middle, so spacetime curvature is the "defining feature" of a gravitational field.    
Why can't light escape a black hole?
Have a look at Ned Wright's deflection and delay of light: 

See where it says this: "In a very real sense, the delay experienced by light passing a massive object is responsible for the deflection of the light". This delay is to do with the "coordinate" speed of light, which is slower when its lower. You can read Einstein talking about this sort of thing in the newly-online digital papers. Somewhat counter-intuitively, an ascending light beam speeds up! Anyway, at the black hole event horizon, the coordinate speed of light is zero, see Wikipedia. Light can't escape a black hole because it's effectively stopped.  
