  Null solutions to Maxwell's equations in free space have the property that
the topology of the electric and magnetic lines is preserved for all time. In
this article we connect the study of a particularly relevant class of null
solutions (related to the Hopf fibration) with the existence of pairs of volume
preserving Legendrian fields with respect to the standard contact structure on
the 3-sphere. Exploiting this connection, we prove that a Legendrian link can
be realized as a set of closed orbits of a non-vanishing Legendrian field
corresponding to the electric or magnetic part of a null solution if and only
if each of its components has vanishing rotation number. Moreover, we prove
that any foliation by circles (a Seifert foliation) of $S^3$ is isotopic to the
foliation defined by a volume preserving Legendrian field with respect to the
standard contact structure. We also construct a new null solution to the
Maxwell's equations with the property that every positive torus knot is a
closed electric line of its electric field. Finally, we prove that any
(possibly knotted) toroidal surface in $\mathbb{R}^3$ can be realized as a
magnetic surface of a null solution to Maxwell's equations, thus implying its
stability for all times. In particular, the associated volume preserving
Legendrian field on $S^3$ exhibits a positive volume set of invariant tori of
the same topological type.
