I've been playing guitar for a few years...all self taught, and I can write some basic riffs on my own (nothing great...but okay stuff) however when I try to jam with a friend who already has a riff/song, I find myself lost.

I don't know much theory, just what I've taught myself (which is probably the main reason for my problem). It seem like all I really do is just follow what they do, but a little higher up, and just make a harmonic part for it...How can I make a part that's completely different, but yet goes with what he/she is playing?

Do I just need to learn more theory? It all just seems so overwhelming that I don't even know where to start. I know there's a few articles on here for complete beginners, but I tried that a year or so ago, and still found myself lost...maybe I'll just have to try it again.

P.S. I can't take lessons because I live in a small town.
I don't know why Mac users get so defensive when you call them idiots. I mean, Apple is a company that has built its entire user base around the fact that its users can't do simple things like turn their computers on.
Hey, I found myself in your shoes about a year ago. What helped me was learning a few scales, and there is an EXCELLENT theory article in Bangoodcharlotte's sig by slash_pwns I believe. Take it at your own comfortable speed, but its very much worth the read.
ahhh..finally a legitimate question. you my friend are in the same spot that i was in about 5 years ago. you can go about conquering your problem in two different ways. the first way...is slaving over theory books and lessons and boring yourself into a stupor and tiring yourself of guitar. or...you can use natural curiousity and intuition to learn new things. I am a completely self taught guitar player. i have no formal giutar lessons...just a term of theory I at school and it sucked. what i do have under my belt is tonssss of musical knowlage. imo..the best way of communicating between musicians is through "band" references. for instance...play someething a little more..iron maiden like..or dream theater like. What i am basically sugggesting is for you to branch off into other areas of music..and just learn as much as you can. try to notice trends that different bands and genres have and eventually..youll be able to combine what youve learend and make great music. it SURE beats the hell out of sitting in a classroom or in front of a computer trying to learn theory.
also...check the band Dream Theater out.
they will change your life.
hoped this helped
In response to that however, learning the musical theory that I have has taught me what I CAN play, and HOW to make what I can't play sound good.

I like that site.
Personally i find reading it and studying it to be easier and more fun. Rather than learning a bunch of songs to combine, cause in the end you still don't know how the particular song flows so well and sounds so good. (or bad) Also, it's nice to watch yourself improve by heaps(at least for me) everyday.

It's easier to remember somthing by reading it, At least IMHO. Don't you think?
Plus you can get a much, MUCH! greater understanding of all music and why everything fits. (or doesn't)

I just starting getting heavily into guitar around a year ago. Started learning Theory a week ago, and i've learned more and improved my playing abilities more just by reading all the theory i could. Then sat in my room finding and playing scales.
mate you should really try to learn some theory, I am also self taught and I could play some cool things without knowing anything about theory, but one day I decided to read and learn some theory stuff, and you know what, I am so happy I did, you may have a lot more skills than me when playing the guitar, but now if I go to jam with a friend, it doesnt matter what riff he plays, I can analyze it and find a scale that suits it and improvise over it no problem

I learned most things I know in this awesome article: http://www.ultimate-guitar.com/lessons/for_beginners/learning_music_theory_the_beginning.html