Preheat broiler. Toss tomatoes and onion with 2 teaspoons oil, 1/2 teaspoon salt, and the red-pepper flakes. Broil on a rimmed baking sheet until tomatoes are just starting to brown, 5 to 7 minutes.
Transfer tomatoes to a 9-inch square baking dish. Broil bread until golden, about 1 minute per side. Halve 1 garlic clove, and rub bread with a cut side. Thinly slice all garlic.
Rinse broccoli rabe, leaving slightly wet. Toss with 2 teaspoons oil, 1/4 teaspoon salt, the garlic, and lemon juice. Broil until leaves begin to brown, about 1 minute. Turn with tongs. Broil, turning once, until just tender, about 2 minutes.
Stir beans and oregano into tomatoes. Dot with ricotta. Drizzle with remaining 2 teaspoons oil. Broil until bubbling, 3 to 5 minutes. Serve over toast and with broccoli rabe on the side.