Making use of twistor structures and the Kerr theorem for shear-free null geodesic congruences, an infinite family of electromagnetic fields satisfying the homogeneous Maxwell equations in flat Minkowski and the associated curved Kerr-Schild backgrounds is determined for any such congruence in a purely algebraic way. The simplest examples of invariant axisymmetric Maxwell fields are presented.