I study guitar as a hobby, beginner-intermediate level. I have weekly jam sessions with a friend who is much more advanced.
I usually play notes from minor pentatonic in the key of what he plays. I sometimes use notes from other scales, although this is much more difficult.
I mostly pluck the notes with the pick, occasionally using bends, slides, hammers,etc., but not so much yet, as I am still learning those.
Occasionally I sound good but a lot of what I do is based on luck, trying to stay in rhythm and when I stumble upon a pattern I like, I repeat it a few times.
Over the course of an hour I become repetitive, and after a few weeks, I feel I am running in circles.
Where could I go from there? Any recommendations on learning material that would help me develop that aspect of guitar playing (which is the reason I got into guitar in the first place).
We usually play blues style, but if there is material from other genres that can help me learn, I am curious to hear it.
EDIT: THANK YOU EVERYONE, I WILL TRY YOUR SUGGESTIONS OVER THE NEXT FEW MONTHS.
Start learning the various modes. Then you can expand and still be in key.