Cook the bacon in a large, heavy sauté pan until crisp, about 5 minutes. Remove the bacon to a paper towel-lined plate to drain. Spoon off the excess bacon grease, leaving 2 tablespoons in the pan. Add the onion to the pan and sauté until soft and very tender, 4 to 5 minutes. Sprinkle in the garlic and red pepper flakes and sauté until just fragrant, about 1 more minute. Add the reserved green beans and cook until heated through, 5 to 6 minutes more. Return the bacon to the pan, pour in the lemon juice and toss. Season with salt and pepper.