how to play against ruy lopez


You say you play the Berlin against the Ruy. That's a fine way to play. Is there a specific game or position that was difficult for you? Here's how the Berlin begins:
All you really need to know about the openings you play is the first 5 or so moves (memorized) and then the general idea (and of course the opening principals) to guide you through the rest. Use a free online database to check (after every game you play) what the popular moves are and through repetition of having played a lot of games you'll eventually memorize the first 5 moves for most of your openings.
For the idea of the opening, maybe use wiki or even post games on this forum and ask for help.
That having been said, it's unlikely openings are your weakest area.
Possibly helpful:
A Spanish Repertoire for Black by Mihail Marin (2007)
https://web.archive.org/web/20140626195205/http://www.chesscafe.com/text/hansen102.pdf
The Berlin Defence by Igor Lysyj & Roman Ovetchkin (2012)
https://web.archive.org/web/20140627104938/http://www.chesscafe.com/text/hansen159.pdf
The Ruy Lopez: A Guide for Black by Sverre Johnsen and Leif Johannessen (2007)
https://web.archive.org/web/20140627023224/http://www.chesscafe.com/text/hansen94.pdf
Bologan's Ruy Lopez for Black by Victor Bologan (2015)
http://www.sjakkbutikken.no/produkter/bologans-ruy-lopez-for-black/
Starting Out: Ruy Lopez by John Shaw (2003)
https://web.archive.org/web/20140627024240/http://www.chesscafe.com/text/hansen53.pdf
Play 1 e4 e5! by Nigel Davies (2006)
https://web.archive.org/web/20140626201436/http://www.chesscafe.com/text/hansen80.pdf
https://web.archive.org/web/20140627083715/http://www.chesscafe.com/text/hansen98.pdf
The Kaufman Repertoire for Black & White by Larry Kaufman (2012)
https://web.archive.org/web/20140626221508/http://www.chesscafe.com/text/hansen162.pdf
The Berlin Wall by John Cox (2008)
https://web.archive.org/web/20140627050257/http://www.chesscafe.com/text/hansen115.pdf
Attacking the Spanish by Sabino Brunello (2009)
https://web.archive.org/web/20140627105306/http://www.chesscafe.com/text/hansen124.pdf
The Ruy Lopez Revisited by Ivan Sokolov (2009)
http://dev.jeremysilman.com/shop/pc/Ruy-Lopez-Revisited-The-p3765.htm
Fighting the Ruy Lopez by Milos Pavlovic (2009)
https://web.archive.org/web/20140627105306/http://www.chesscafe.com/text/hansen124.pdf
Slay the Spanish by Timothy Taylor (2011)
https://web.archive.org/web/20140627040230/http://www.chesscafe.com/text/hansen146.pdf
Grandmaster Repertoire 13 – The Open Spanish by V. Mikhalevski (2013)
http://reviews.dailychess.org/grandmaster-repertoire-13-the-open-spanish-qualitychess-by-v-mikhalevski/
Anti-Spanish. The Cozio Defence by Alexey Dreev (2014)
Playing 1.e4 e5 - A Classical Repertoire by Nikolaos Ntirlis (2016)
The Spanish Main Road by Evgeny Solozhenkin (2016)