Certified GKH Gardening Expert
This can happen with too much sun. The fruit does not tolerate direct sunlight very well, and can get worse when moisture is present.
There is a chance that there could be a true magnesium deficiency, but this is not very likely.
Here is a collection of articles that will help: