The dynamics of phototaxis in photosynthetic microorganisms