When tomatoes, peppers, melons, and eggplant develop a sunken, rotten spot on the end of the fruit, the cause came long before you found the problem. It's called blossom end rot, and here is why it happens.
Vegetables need calcium for healthy development. When tomatoes, peppers, melons, and eggplant can't get enough from the soil, the tissues on the blossom end of the fruit break down. The calcium shortage may be because the soil lacks calcium, or calcium is present but is tied up in the soil chemistry because the pH is too low. Also, drought stress or moisture fluctuations can reduce its uptake into the plant. Another reason is that too much fertilizer causes the plant to grow so fast that the calcium can't move into the plant quickly enough.
The best way to avoid blossom end rot:
Start now by testing the soil. Although most vegetables do well with a soil pH of 6.2 to 6.8, for those with blossom-end the pH should be 6.5 to 6.8 to free more calcium in the soil chemistry. Test results will indicate the amount of lime to add. Even better, lime also contains calcium. Work the lime into the top 12 inches of soil. Use a lime labeled "fast-acting," which is better than ground limestone unless you have weeks to wait for the lime to react in the soil. If the pH is already correct, the soil test will recommend a different calcium source, such as gypsum. Also, add crumbled egg shells to your compost or bury them in your garden over time to help maintain the calcium levels.
Fertilize wisely. Use a fertilizer at planting time that contains calcium, such as Miracle-Gro® Shake ‘n Feed® Tomato, Fruit & Vegetable Plant Food. Whichever fertilizer you choose, be sure to follow the directions on the label so you'll know how much to apply, as it's important not to over-fertilize. Adding too much nitrogen during early fruiting, especially if the nitrogen is made from ammonia, ties up calcium in the soil chemistry.
Avoid moisture stress. Use mulch to keep the soil evenly moist. Vegetables need about 1 to 1 1/2 inches of water a week while fruiting. The best way to water tomatoes planted in the ground is with a soaker hose. In hot climates it is especially tricky to keep big tomato plants in pots watered well during the summer. Make sure to water them daily or set them up on a drip system with a timer.
As a stop-gap measure, spray tomato plants with a calcium solution made for blossom-end rot. Follow label directions. Apply two to three times a week, beginning when the first blooms appear. This is not a long-term fix, but it may salvage your crop until you can take the steps mentioned above. The spray seems to work better on tomatoes than other vegetables.