http://www.zentao.com/guitar/theory/intervals.html
the diff between an E and a D pentatonic scale is just the key and different areas of the fretboard to do the pentatonic...hence the 2nd link
http://www.jamsess.com/test/guitar.phtml
the second link allows u do figure out the different notes in a particular scale...say if a riff was done in an E chord or whatever then u wud use an E scale so it matches...again im no pro at scales i cud be wrong at any point here (altho im pretty sure im not)...as to master a scale..yes yes practise...improvation and solos are spontaneous mostly..thats the beauty of it...stuff like these are more theory based (which i hate)..but yeah theory wud do u a great deal of help.. theres reading to do and itll help u understand more the fundamentals of scales and etc..those 2 links posted shud be able to help u understand reading the scales and understanding them...if u still find difficulty, never hesitate to ask further questions...
[FONT=Impact]grooviest tunes ever [/FONT]