Bring a pot of salted water to a boil. Add 1 box pasta and cook until al dente, then drain.
Meanwhile, heat 2 tbsp olive oil over medium heat in a saucepan. Add 3 cloves minced garlic and ½ tsp red pepper flakes. After a minute, add 8 oz spinach or kale and a pinch of salt. Saute until the spinach wilts, 2 to 3 minutes.
Add the spinach to a blender along with ¼ cup fresh basil, 1 14 oz can of white beans, and the juice and zest from 1 lemon. Blend until smooth.
Combine the sauce and pasta and serve.
