Puree the tomatoes to a smooth, creamy consistency in a food processor or with an immersion blender. (If you like a more country feel, you can wait and break them up in the pan later with a wooden spoon.)
Heat the olive oil over medium-high heat in a large saucepan. When hot, add the onion and saute 5 to 6 minutes, or until soft. Add the garlic and cook 2 to 3 minutes, until you see the color start changing. If you'd like to make the sauce spicy, add the red pepper flakes.
Add the tomatoes and season with salt and pepper to taste. Reduce the heat to medium low and simmer about 30 minutes. (If you did not puree the tomatoes, use a wooden spoon to break them into pieces while they cook.) Strive for balance in the consistency of the sauce: It has to be fluid, but it should not look overly wet. Add the basil and remove from the heat. Toss with just-cooked pasta.