Bring a large pot of water to a rolling boil. Add a generous handful of salt (about 2 tablespoons). Add your pasta and cook until al dente.
Before draining, reserve 1 cup of the starchy pasta water. Set aside.
While pasta cooks, combine ricotta, lemon zest, grated garlic, a big pinch of salt, and several grinds of black pepper in a medium bowl. Whisk until smooth.
In a large skillet, melt butter over medium-low heat. Swirl to coat the bottom. Do not let it brown.
Add the drained pasta directly to the skillet with the melted butter. Toss to coat.
Remove the skillet from the heat. Add the ricotta mixture and about half of the reserved pasta water. Toss vigorously with tongs until the sauce is creamy and clings to the pasta.
Drizzle in the lemon juice and add half the Parmesan. Toss again. If sauce is too thick, add more pasta water a tablespoon at a time until it reaches a light cream consistency.
Taste and adjust seasoning with salt, pepper, or red pepper flakes. Divide into bowls and top with remaining Parmesan, fresh basil if using, and another sprinkle of red pepper flakes. Serve immediately.