In a vacuum photons travel along geodesics, to be specific null-geodsics, which can be considered 'straight lines'. If the presence of an intermediary mass causes a light ray to be deflected, the path of the photon is still 'straight', it just happens to be along a surface of space-time that itself is curved by the presence of the gravitating mass.
So in this case the photon is not said to 'accelerate'.
Garth