Bb/g5 in the opening?


I am relatively new to the game and this seems to be a common move in the opening (especially Ruy lopez,Bb5, but others also).  How do you defend against the ensuing end pawn (a/h6) defense?  Do you retreat?  I have always felt if I retreat along the path I cam I lose tempo onto a position that is not as good, so why make the original move at all?  and if I move to a/h4 inevitably you have to deal with b/g5 forcing full retreat and losing tempo, I think.  Why is this move so common?  Is black weakened later in the game by this pawn move which I have not exploited yet?


I have not been able to find a great answer in books (granted I am not always sure where to look) as many opening seem to end with this move! How frustrating! lol.


Thanks in advance for the help,