Charge Dynamics Near Phase Transitions In Two-Dimensional Systems