Rocks formed along a beach would be sedimentary rocks. These rocks are formed by the weathering of old stones. Weathering happens when the rocks are moved around by water in the ocean, can also be called erosion.
The smaller pieces of stones settle on the ground in layers together with organic material from plants and animals. With time, they harden to form sediment.