A Berks County sheriff's deputy was in the right place at the right time to foil an armed robbery in progress.