We address the traffic light control problem for multiple intersections in tandem by viewing it as a stochastic hybrid system and developing a Stochastic Flow Model (SFM) for it. Using Infinitesimal Perturbation Analysis (IPA), we derive on-line gradient estimates of a cost metric with respect to the controllable green and red cycle lengths. The IPA estimators obtained require counting traffic light switchings and estimating car flow rates only when specific events occur. The estimators are used to iteratively adjust light cycle lengths to improve performance and, in conjunction with a standard gradient-based algorithm, to obtain optimal values which adapt to changing traffic conditions. Simulation results are included to illustrate the approach.