Binary gratings recorded in anisotropic (birefringent or dichroic) media exhibit peculiar polarization properties and a method to calculate the polarization states and the irradiances of diffracted spots in the Fraunhofer diffraction pattern for an incident wave of arbitrary polarization state is proposed. The gratings under consideration have periods made of domains of different widths in which the anisotropic medium can be in two states. Anisotropic modulation results in spatial modulation of polarization with two possible states; for every spot in the diffraction pattern, the polarization state and the irradiance are derived as functions of these two states and are shown to depend on the order of diffraction of the spot. More specific results are obtained for phase shift, axis or mixed birefringence modulations and a comparison between the relative irradiances obtained in each case is established. The theory is illustrated by experimental results with ferroelectric liquid crystals.