One of the most critical issues in the oil and gas industry is the dewatering of the pipelines used for natural gas transportation, and foam injection seems to be a prominent solution. This work has two goals: The main one concerns the development of an optical tool to measure the liquid holdup in foamy flows and perform the flow regime characterization, whereas the secondary goal is to quantify the effectiveness of surfactant injection in reducing the liquid loading. In this paper, we present the results of an experimental campaign aimed at the characterization of gas-liquid-foam flows in a horizontal pipe. Initially, liquid loading measurements for gas and liquid superficial velocities, ranging from 0.41 to 2.30 m/s and from 0.03 to 0.06 m/s, respectively, were performed by means of a specifically developed optical method. For each liquid superficial velocity, the minimum liquid holdup was found to lie in the proximity of the boundary between plug and stratified flow regime, with a superficial gas velocity between 0.44 and 0.90 m/s. Hence, the plug flow region corresponds to the best operating condition to perform the pipeline dewatering procedure. Moreover, the drift-flux model usually adopted for ordinary two-phasegas-liquid flows seems to fit well with the measured values of void fraction.