In these situation photons are either bouncing off matter or are getting absorbed and emitted by matter. In the former case they don't travel a straight path, in the latter case there is a short time lag between absorption and emission.