Ok, this is how I solo, basics first, scales is a must know. And, to make the solo sound "matching" with the chord progression, take down the chords. Lets say our chord progression is, Am F G C.
Notes in chords:
Am - A, C, E
F - F, A, C
G - G, B, D
C, C, E, G
So, when that chord is being played, in your solo, you hit any of those notes in the chord. E.g The chord being played is Am, so you can hit notes A, C or E, or chord F is being played, you can hit notes, F, A, or C it will sound "nice". Then the rest just play around the scales first. But for this to work, around a basic minor pentatonic scale, make sure the progression is theorically correct, or else it may be a little bit harder.
I use this method for blues jam or maybe some slower metal. There are many other ways of soloing, myself being a beginner, I find this method easy and may also be used in like freestyle soloing/improvisation.
Cheers!