Theory of frequency and phase synchronization in a rocked bistable