Electrodynamics and phase transitions in materials with magnetic monopoles