I can’t say that I have a good answer to this as I’ve been trying to address the same issue myself. I’ve spent quite a while learning guitar solos that I like and trying to identify handy licks and riffs to, er, borrow. I also try and analyse the solo to see what’s being played over the underlying chord. And finally, I try and get a melody in my head and play that, then extemporise around it.
At least, that’s what I try to do. Results are patchy at the moment but I do get the occasional “ooh that was nice” bit and not always by accident.