Peru is very well known for its surfing beaches, but those are generally up and down the coast from Lima. In Lima itself, your choices are fairly limited. But hey, there are just some times when you have to go to the beach. When the compulsion becomes too much for me to take, I usually head out to La Punta.
La Punta is a stone beach with cold water, but the sun is so hot that you want it that way. It costs around 20-25 Soles to get to the beach from the Ovalo de Miraflores, and it's a good way to spend your morning (even better than laying in bed and drinking wine while eating croissants and cheese if you can believe it).
Here's a map that gives you an idea as to where it is:
Check it out!