A phase modulator could refer to several different devices.
In the 22nd century, a phase modulator was the primary component of phase-modulated energy weapons, including phase-pistols and phase cannons, utilized by Starfleet. The modulator was the component which shifts the intensity of the weapon's energy beam.
In 2151, the phase modulator of the recently-installed phase cannons aboard Enterprise NX-01 overloaded due to interference from a hostile alien species, and the energy output of the cannons was ten times more powerful than expected. The overload also caused a plasma recoil, which blew out relays on decks C and D.
When the aliens returned and attacked the Enterprise, the phase cannons were ineffective against their starship. Chief Engineer Charles Tucker and Armory Officer Malcolm Reed then intentionally overloaded the modulators a second time, using the gravity plating of the affected decks to absorb the recoil. The overload once again increased the weapon's output, allowing Enterprise to damage the enemy vessel. (ENT: "Silent Enemy")
In 2370, while infiltrating Cardassian space in a runabout disguised as the Lissepian transport Martuk, Kira Nerys claimed to a Cardassian border guard that they were having trouble with their phase modulators, as cover for Chief Miles O'Brien's modifications. (DS9: "The Homecoming")
A phase modulator was also a type of engineering tool. In 2374, Lieutenant Commander Tuvok used a phase modulator when preparing a gravimetric torpedo for the enactment of the Omega Directive. (VOY: "The Omega Directive")