Worms on Bean Plants

How do I control the little white worms eating my bean plant stems? About 20 percent of my healthy looking, yellow bean plants have fallen over. When I open up the stem of the fallen plant at ground level, I find several small white maggots. How do I control them so that the rest of the bean plants survive?