Hens will eat their eggs for a variety of reasons. Often it is because they are not getting enough vitamins. Make sure they always have access to a calcium supplement, like an oyster shell. They may have accidentally broken an egg originally because the shell was thin from lack of calcium. Sometimes they are bored and just end up pecking at an egg because it's something different in their coop. Make sure they have time to roam and lots of fun things to do so they don't make their own amusements.
Once a chicken starts eating eggs it can be nearly impossible to stop. Pick up the eggs as soon as they're laid, if possible. Figure out which chicken is doing it and divide her from the flock. They will teach other chickens to eat eggs, so you may want to keep the culprit separated. Some people have had good luck adding some dummy eggs to the nest, but chickens are often smarter than we realize. There are also accounts of people hollowing out eggs and replacing the innards with pepper for a nasty surprise. If you get desperate, it may be worth a shot.