You are describing Blossom End Rot. This is thought to be caused by insufficient calcium. However, don't rush out to by a calcium supplement for your soil. This calcium deficiency is probably caused by irregular watering and a fluctuation in water levels. Water carries calcium throughout the tomato plant. Without enough water, the calcium, which is being used first for foliage growth, doesn't make its way to the fruits. Other factors may include: too much nitrogen fertilizer, too much salt in the soil, root damage and a soil pH that is too high or too far below the optimum 6.5.
There's no saving the rotting fruits. Remove the affected fruits, make sure the plants are getting at least and inch of water per week, correct any other problems, mulch under the plants and you should see improvement.