you should have a base for the solo, and a chord proggresion behind it, and then just to play what your heart tells you, but of course its practice matter as well, because only if you'll practice much you'll know how to improvise a good solo
good example is led zeppelin's since ive been loving you, from the song remains the same video
there are a small part which is exactly the part from the original studio solo, and the rest comes straight from his heart to the freatboard
"They think im crazy..
but i know better.
It is not I who am crazy.
It is I who am mad.."
ren hoek
but i know better.
It is not I who am crazy.
It is I who am mad.."
ren hoek