This is going to be a tough one, so get prepared for the ride. There are 55 rainbow medals in the game across 11 worlds, and some of them require some advanced techniques to earn.
The main technique that is the easiest to pull off is a jump out. A jump out is when you jump right as you're coming out of a downwards incline. This has maximum effectiveness if you time it in the middle of the transition of the track pieces, as with most jumps. That is, unless the incline is not curved i.e \___ , then jumping out at the last possible moment is most effective.
Other ways of saving time involve double jumps in some cases, and jumping into ramps such that your angle of entry matches the ramp as closely as possible.
I have included a video of all of my routes for the rainbow times. I recommend trying to get the one in the first level first, as it is one of the harder ones to get and it will better prepare you for the others.