In a 5- to 6-quart pan over high heat, bring 3 quarts water to a boil. Add beans and cook until tender to bite, 5 to 6 minutes. Drain beans and immerse in ice water until cool, about 3 minutes; drain again.
Pour olive oil into same pan over medium-high heat; add onions and stir often until limp, about 8 minutes. Add tomatoes with liquid; stir occasionally until sauce is reduced to about 2 1/2 cups, about 10 minutes. Add beans and stir occasionally until hot, about 5 minutes. Season to taste with salt and pepper.