Preheat oven to 425°F (220°C). Pat chicken dry and season with salt, pepper, and thyme.
Toss green beans with olive oil, a pinch of salt, and pepper; spread in a single layer on a rimmed baking sheet.
Place thighs skin-side up among the beans. Drizzle melted butter and minced garlic evenly over chicken and beans.
Add lemon slices on and around the thighs and sprinkle red pepper flakes if using.
Roast 30–35 minutes until chicken reaches 165°F and skin is golden; broil 2 minutes if you want extra crisp.
Let rest 5 minutes, spoon pan juices over chicken, and serve.