The first factor is the shape of the sunglasses. Learn how to choose the best sunglasses' shape based on the shape of your face. The prevailing style theory is that you should balance the shape of your face with an opposite shape in sunglasses.
The second factor, once you've determined your most flattering sunglasses' shape, is the frame's style and color. Personally, I think wire frames aren't the best choice for beach wear. It's better to go with a plastic or resin frame, and since sunglasses may get tougher wear at the beach, it's not a bad idea to wear inexpensive sunglasses to the beach and save your designer shades for other occasions. Color-wise, pick a hue that contrasts or coordinates with your swimsuit or just a trendy and fun color that makes you happy.