1. Bring a large pot of water to a boil over medium-high heat. Add spinach and cook just until wilted, about 45 seconds. Use a slotted spoon or fine sieve to transfer the spinach to a blender. Return the water to a boil and add spaghetti and potatoes. Cook, stirring once or twice, until almost tender, 6 to 7 minutes. Add green beans and cook until tender, 3 to 4 minutes more.
2. When the spaghetti and vegetables are almost done, carefully scoop out 1 cup of the cooking liquid from the pot. Pour 1/2 cup of the liquid into the blender and add pesto, pepper and salt. Blend until smooth, stopping to scrape down the sides as necessary.
3. Drain the spaghetti and vegetables and return to the pot; stir in the pesto mixture. Cook over medium heat, stirring gently, until the sauce is thickened and the pasta is hot, 1 to 2 minutes. Add more of the cooking liquid, as desired, for a thinner sauce.