Voltage indicators function by undergoing a change in their optical properties, such as fluorescence or absorbance, in response to changes in membrane potential. This allows researchers to visualize and quantify electrical activity in real-time. For example, a change in voltage across the membrane can cause a conformational change in the indicator molecule, resulting in a shift in its fluorescence emission spectrum.