What might have done this to my beans?
Thank you for contacting the Toronto Master Gardeners with your inquiry about your beans.
From the photo it appears that your bean pods could have been affected by some type of sucking insect. Aphids, bean leaf beetle both suck nutrients from young leaves however the bean leaf beetle has been known to attack the outer wall of the bean pods when vegetative growth has stopped. Leaf bean beetles are reddish to yellowish-brown beetles are 5 to 6 mm long and often have three black spots on each wing cover.
NC State Publication Pests of Beans and Peas lists the following pests that primarily feed on pods. It gives descriptions and photos of each pest as well as illustrations of their damage.
Without knowing exactly what the pest is that is doing damage it is difficult to recommend an appropriate treatment. My suggestion would be to go out early in the morning or late evening and see if you happen to notice any insects hiding under the bean leaves or munching on the bean pods.
For additional information on the various pests and diseases of beans see the following links: Bean Leaf Beetles in Home Garden,
Good Luck with your beans.