© 2016 American Physical Society. We use microwave temperature maps from two seasons of data from the Atacama Cosmology Telescope at 146 GHz, together with the "Constant Mass" CMASS galaxy sample from the Baryon Oscillation Spectroscopic Survey to measure the kinematic Sunyaev-Zel'dovich (kSZ) effect over the redshift range z=0.4-0.7. We use galaxy positions and the continuity equation to obtain a reconstruction of the line-of-sight velocity field. We stack the microwave temperature at the location of each halo, weighted by the corresponding reconstructed velocity. We vary the size of the aperture photometry filter used, thus probing the free electron profile of these halos from within the virial radius out to three virial radii, on the scales relevant for investigating the missing baryons problem. The resulting best fit kSZ model is preferred over the no-kSZ hypothesis at 3.3 and 2.9σ for two independent velocity reconstruction methods, using 25,537 galaxies over 660 square degrees. The data suggest that the baryon profile is shallower than the dark matter in the inner regions of the halos probed here, potentially due to energy injection from active galactic nucleus or supernovae. Thus, by constraining the gas profile on a wide range of scales, this technique will be useful for understanding the role of feedback in galaxy groups and clusters. The effect of foregrounds that are uncorrelated with the galaxy velocities is expected to be well below our signal, and residual thermal Sunyaev-Zel'dovich contamination is controlled by masking the most massive clusters. Finally, we discuss the systematics involved in converting our measurement of the kSZ amplitude into the mean free electron fraction of the halos in our sample.