Here's some great info from Yara Crop Nutrition about what elements your tomato plants need, and when they need them.
As you can see from the graph, tomatoes need a lot of Phosphorus in their developmental days, but as time goes by, the need declines while the requirement for nutrients like Calcium, Potassium, Nitrogen, and Magnesium increases. Calcium and Potassium are particularly important during the stage immediately before flowering. In fact, Potassium supplementation should be increased as soon as flowers start to form on the plant.
Lack of Potassium can lead to fruit that develop green splotches and white interior walls ("green shoulder" and "ghost wall" respectively) that make fruit undesirable, though not necessarily inedible.
Lack of Calcium causes the common "Blossom End Rot" problem where the bottom end of the tomato will turn black and rotten.
Both of the above problems must be corrected by adequate nutrition before the fruit is formed. Once the fruit is set, these problems cannot be fixed. However, new fruit that forms on the plant can be corrected if the nutrient imbalance is rectified.
^ Ghost Wall in tomato- Caused by a lack of Potassium
^ Green Shoulder in tomato- Caused by a lack of Potassium.