Terahertz pulsed spectroscopy of medium polymerization