Heat the oven to 425°F.
Bring a large pot of salted water to a boil. Add the pasta and cook for 3 minutes less than the package directions for al dente.
Meanwhile, in a large bowl, stir together the cottage cheese, basil, lemon zest, 1/2 cup of the mozzarella, 1/4 cup of the Parmesan, 1/4 teaspoon salt and several grinds black pepper.
In a 10-inch ovenproof skillet, heat the oil over medium-high heat until shimmering. Add the artichoke hearts and cook, stirring, until beginning to brown, 2 to 3 minutes. Add the spinach a few handfuls at a time and cook, stirring, until just wilted, about 2 minutes. Add the garlic and red pepper flakes and cook, stirring, until fragrant, about 30 seconds. Remove from the heat and stir the veggies into the cottage cheese mixture.
Return the cooked pasta to the now empty skillet. Add 1 cup of the marinara sauce and stir to coat. Dollop the cottage cheese mixture all around the skillet. Spoon the remaining 1 cup sauce over top. Sprinkle with the remaining mozzarella and Parmesan cheeses.
Bake until the sauce is bubbling and the cheese is browned in spots, 20 to 25 minutes. Drizzle with pesto before serving (if using), and finish with more fresh basil.