As I understand it, photons can meander in any direction at any time but due to the way probabilities cancel each other out, they tend to move in a straight line when not in the vicinity of other particles.
However, because EM diffraction is observable at macroscopic scales, the "straight line" thing really is confusing. Growing up, I always wondered how radio waves transmitted through walls and assumed they just went through them when in fact they go around.