This is usually caused by not watering and feeding properly. It's a disease called blackheart which makes the fruit darken on the inside. Some people use calcium once they notice the condition and this does help to contain the outbreak - best not to let it get to this stage. Make sure you water regularly and use a good tomato feed every week. I garden organically so usually use a feed which contains seaweed - amongst other things.
Hope this helps :-))