They are called corn earworms. One way to reduce the damage from earworms is to
plant a variety of corn with tighter husks that make it more difficult for the worms to make it to the corn.
You can also apply half a medicine dropper of mineral oil to the silk on each ear after the silks have wilted and begun to turn brown. The mineral oil works by suffocating the worms, but doesn't affect the taste of the corn. To make it even more effective, add some red
pepper, pyrethrin, or BT(bacillus thuringiensis). Make 2 follow-up applications a week apart.