Gems stop spawning at a certain amount of bonus points collected (500??), so try and get to 480 or 490, whichever is the maximum amount before gems stop spawning, then keep flying until you hit the cave section with 6 gems within the same range to finish collecting your bonus points. Even better if one or more of those gems is red.