Remove hens with pieces of eggshell or traces of egg yolk on their beaks from the flock, immediately. Pecking and eating eggs is a learned behavior that the other hens will pick up quickly.
Provide your hens with calcium supplements for chickens, which you can obtain from leading chicken feed suppliers. Alternatively, provide your hens with a dish of milk. If you satisfy their need for calcium, they will be less inclined to peck at their own eggs.
Make eggs disagreeable to your hens. Beat one egg, mix its contents with black pepper and pour it all over the floor of your hen house. Your hens will sniff at the mixture, find it disagreeable and find themselves less inclined to eat eggs.
Provide a minimum of one 12-inch-by-12-inch nest for every four layer hens, preferably raised a couple of feet off the ground.