Bacterial spots can lead to marks like those, but it's also likely to have affected the foliage. There are a number of insects that tube feed from your fruit, causing black necrotic spots like that as well. In both cases the black is secondary rot from the initial damage to the skin and immediate tissues. Technically, poking the fruit with a pencil a couple weeks before it is ripe can do the same.