Glass surfing is a symptom of boredom and lack of exercise. Giving your female more space and more environmental enrichment can help with this behavior. Try putting some plants against the surface of the tank that she most frequently surfs--try rearranging the decor in her tank every week, or add more little things like colored marbles and whatnot. Another idea is to place new interesting, colorful objects around the outside of the tank every day--the fish will sometimes spend hours studying them.
If she is in a small tank, less than 2.5G, I strongly advise that you upgrade her tank to a larger size. Just like in dogs, fish will develop neurotic behavior if they are confined and understimulated. A good analogy is my own dog, who was rescued from a hoarder who kept her in a bathroom almost her whole life, even though she isn't confined anymore she still runs in little circles whenever she's scared or excited because it's how she coped with her anxiety for all those years. Sometimes it's extremely difficult to break the behavior of glass surfing if they've been doing it for a very long period of time.