Pull over and wait for them to catch up! If you ruin someone else's race, you deserve the same fate and while it will suck at the time you'll feel better about doing it than leaving someone behind. But! Think for a moment before you just stop in the middle of the road, make sure you choose a place to stop that isn't going to lead to issues for other racers. The last thing you want to do is, in the middle of trying to be courteous, cause other drivers to have issues. And when you rejoin the race, make sure to do so at a time when you're unlikely to cause issues for other drivers! This may lose you a place or two more than going out into the race as fast as possible, but it is safer and you'll be a better driver for doing it.
On a deeper level, you need to ask yourself why it is you ended up hitting that person in the first place. Was it an issue of losing control during a difficult section? Did you not react to a move they were making properly? Did you lag into them? Dealing with an accident respectfully is important, but learning from the accident and not making the same mistake twice is even more important.
If you're getting into crashes because you're losing control at a bad time or not expecting something someone else does, even if what happens isn't really your fault, you should think about whether or not you should be doing that move in the first place. Going three-wide into a thin section of track is begging for a crash. Going side-by-side through a tight corner at full speed is also asking for a crash. Driving your standard racing line when two people just in front of you are battling is begging for a crash. Driving as close as possible to someone when either you or they are laggy is begging for a crash. Just play it safe, you may lose time by not going all out but you'll lose a lot less than you would if you crash out.