If all other spots are occupied then that colour will be replaced by the referee as near to it's own spot without touching another ball, in a direct line to the top cushion (black cushion if it's easier for you to understand).
According to the Rules Book, "If all spots are occupied, the colour shall be placed as near its own spot as possible, between that spot and the nearest part of the top cushion.
In the case of Pink and Black, if all spots are occupied and there is no available space between the relevant spot and the nearest part of the top cushion, the colour shall be placed as near to its own spot as possible on the centre line of the table below the spot.
It's pretty simple really, what you got to remember is sometimes a ball does not seem to have enough space to be spotted, but in fact it does have, that's why you see referees carrying a ball marker and checking if that particular spot is available. If not, then what I described above applies.