Droplets are natural candidates for use as microfluidic reactors, if active control of their formation and transport can be achieved. We show here that localized heating from a laser can block the motion of a water-oil interface, acting as a microfluidic valve for two-phase flows. A theoretical model is developed to explain the forces acting on a drop due to thermocapillary flow, predicting a scaling law that favors miniaturization. Finally, we show how the laser forcing can be applied to sorting drops, thus demonstrating how it may be integrated in complex droplet microfluidic systems