Waves on sandy beach separating differently-sized rocks? I recently went to a beach, and I noticed that the sand seemed to have a few distinct regions.  I'm wondering what would cause this, and how it works.

One region is the part of the beach which is kept wet by the waves, but is far enough away that most waves don't seem to reach all the way to the end of it.  This part consisted of small-grained, "soft" sand.

This region is followed by a region with a lot of small rocks (mostly the size of, say, someone's smallest toe).  This region was located a bit past (i.e.: further into the water) the lowest point the water tended to reach.  This size of the grains of sand of this region blends smoothly into the previous region, so they get progressively larger as you walk further out to the water.

The last region is another one of fine-grain sand, and it also had ripples in it (I'm assuming that this is just because of the waves, because I noticed that the waves picked up sand from the peaks of the ripples and pulled it back out to sea).

The first two distinct regions seem to be the result of some type of sorting mechanism induced by the wave.  If so, how does this work?

And why was there a second region of fine-grain sand after the coarse-grain region?
There are two ways in which waves can sort particles on a beach, and both depend on surface area to weight ratio. The larger, toe-sized particles you describe have less surface area to volume (weight) ratio than the sand-sized particles, so were first to drop out of the water flow. The lighter particles had more surface area per unit of weight for the waves to act on, so were slower to drop out and were carried further up the beach. Why the lowest level sand grains were precipitated in deeper water, before the toe-sized particles, is less easy to understand, but one possible reason is that they contained some heavy mineral such as tin, which altered the surface area to weight ratio and caused them to drop out first. This principle is well seen in gold panning machines, where the heavy gold particles drop out of the flowing water first,while the lighter particles are carried further on, even when they are larger than the flecks of gold.