When davening Shmonei Esrei one’s body must be covered. Therefore, when one is at the beach wearing just their bathing suit or in any other similar situation, they cannot daven Shmonei Esrei. (Bidieved, if one did daven Shmonei Esrei while not fully covered, they do not need to repeat it.)