Light is in fact effected by gravity. Einstein's general theory of relativity says that gravity will effect anything with energy. Photons are full of energy, though they do not have mass. This is mathematically described by the Maxwell's stress energy tensor.
Since according to Einstein, gravity is a distortion or a curvature in space-time, thus any entity with energy when it encounters such a curvature will react accordingly and same happens with light.
You might have heard of gravitational lensing in which light bends around a massive object. This is because a massive object causes greater curvature of space-time and it governs the path light will take when it interacts with the distortion in the space-time fabric.