When it comes to soloing, creativity, flexibility, and dynamic ability are paramount. You may solo fast over a melody with a fast tempo, matching or even increasing the speed. You can also do the opposite and play slow over a melody with a slower tempo. Also consider soloing fast over a slow melody, and slow over a fast melody.
Now consider mixing it up and doing a combination of these techniques to add dynamics to your solos. You may be soloing slowly, then pick it up and solo fast; or you may do the opposite and start off soloing fast and then slow it down.
There are infinite combinations you can do, and having a changing melody behind you can also add a lot of dynamic sound and flavor to the mix. Practice soloing alone as well as with different melodies to discover different sounds, styles, and techniques. It will make you sound better, and it will make playing that much more fun!
Are you a blues player? Try playing some heavy metal! Are you a metal musician? Try playing some blues, or some jazz, etc. Strive to be a well-rounded musician.