Stochastic Control of Beam Dynamics