It is not at all uncommon for layer hens to peck and eat their own eggs. Hens tend to do this in response to nutritional or space deficiencies, and if these are issues for your hens, you should correct the problems by providing them with well-balanced chicken feed and adequate room. It is also helpful to raise nests off the ground. Should you need to stop the problem immediately, though, there are additional options.
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.