Photons do have mass, because energy has mass & photons carry energy. They have no rest mass, which is why they are usually described as massless, but this isn't the whole story!
Radiation pressure. Remember, solar sails are a thing. At some point, you're blazing through spacetime so fast all that energy you're trying to share the same physical location with is impacting and ablating your hull material.
What photons do have is momentum, and so due to conservation of momentum, hitting a photon will slow you down.