Put the butter in a large deep skillet over medium-high heat.
When hot, add the onion and cook, stirring occasionally, for about 5 minutes.
Meanwhile, cut the ham into 1/2-inch chunks.
Add it and raise the heat to high.
While the ham cooksstir it occasionally, but let it brown a bit on the bottompeel and core the pears and cut them into 1-inch chunks.
Lower the heat to medium and add them to the pan; stir occasionally.
Trim the beans, cut them into roughly 2-inch lengths, rinse them quickly, and add them to the skillet along with a sprinkling of salt and at least 1/2 teaspoon pepper.
Cook for a minute, then raise the heat to medium-high, add the chicken stock, and stir.
Cook, stirring occasionally, until the beans are bright green and semitender, the pears are quite tender, and the liquid so reduced that it is essentially a sauce, 10 to 15 minutes.