Put them in a kennel. If you are worried about them getting run over, you should have already thought of this idea. A shock collar won't work unless you are around enough to catch them doing it every time for about 2 weeks.
The only way to keep them from doing this is to put them in a kennel or give them something to keep them in the yard. I breed dogs and use them daily, but it doesn't hurt my feelings to feel the bump of a dog under the tires of a dog that jumps out of the ditch to chase my truck.