Preheat the oven to 400°F (200°C). Halve the tomatoes and smash the garlic cloves.
Arrange the halved tomatoes cut-side up on a sheet pan. Tuck the smashed garlic cloves between them. Drizzle generously with olive oil and season with salt, pepper, and a pinch of red pepper flakes. Roast for 30-35 minutes, until the tomatoes are wrinkled and caramelized at the edges and the garlic is soft.
While the tomatoes roast, bring a large pot of generously salted water to a boil. Cook the pasta until just shy of al dente. Reserve 1 cup of the pasta water before draining.
Transfer the roasted tomatoes and garlic to a large skillet or Dutch oven. Use a fork or potato masher to smash them into a chunky sauce. Add a splash of the reserved pasta water (about 1/4 cup) if it looks dry.
Add the drained pasta to the skillet with the smashed tomatoes. Toss well to coat, using tongs to lift and turn the pasta. If it seems dry, add another splash of pasta water. Cook over low heat for 1-2 minutes, allowing the pasta to absorb the flavors.
Remove the skillet from the heat. Let it rest for 30 seconds. Dollop the ricotta over the pasta and fold it in gently with a spatula or wooden spoon. The residual heat will melt it into a creamy sauce.
Taste and adjust salt. Serve immediately topped with torn basil, an extra dollop of fresh ricotta, a pinch of red pepper flakes, and a generous drizzle of good olive oil.