As Stephen walks across the "damp crackling mast, razorshells, squeaking pebbles" in Proteus, an inexactly remembered line of Shakespeare's verse drifts into his mind: "that on the unnumbered pebbles beats." This detail from King Lear insinuates an association of "pebbles" with danger and death that recurs several times in the novel.
According to the OED, "mast" can be a collective name for the nuts of various forest trees, especially when used as food for pigs. Stephen may possibly be thinking of various kinds of vegetable matter that have been ground up to make the beach, along with seashells, bits of rock, and wood from wrecked ships.
In King Lear 4.6, the blinded and despairing Gloucester wants to commit suicide by jumping from the cliffs of Dover. His son Edgar, in disguise, tricks the old man into believing that he is standing on the top of a cliff, far above the beach:
The fishermen that walk upon the beach
Appear like mice; and yond tall anchoring bark,
Diminished to her cock; her cock, a buoy
Almost too small for sight. The murmuring surge,
That on th' unnumb'red idle pebble chafes,
Cannot be heard so high.
Gloucester throws himself off what he believes to be a cliff, but instead of plummeting through air and smashing against the pebbles far below, the audience sees him merely topple forward onto his face.
Stephen seems to be merely recalling a line of iambic pentameter with pebbles in it, rather than meditating on the action of the play. But pebbles do return several times in the novel in ways that suggest the author may be thinking about the scene, and about Gloucester's brush with death.
In Lestrygonians Bloom recalls lying high on Howth Head with Molly and hearing pebbles roll off the cliff to the sea below: "Flowers her eyes were, take me, willing eyes. Pebbles fell. She lay still. A goat. No-one. High on Ben Howth rhododendrons a nannygoat walking surefooted, dropping currants." Later, in Nausicaa, he is sitting on the same beach that Stephen has walked on and thinks about the impossibility of numbering pebbles: "All those holes and pebbles. Who could count them?"
In Hades pebbles are associated with an old grey rat that lives on intimate terms with the dead: "Rtststr! A rattle of pebbles. Wait. Stop! . . . An obese grey rat toddled along the side of the crypt, moving the pebbles. An old stager: greatgrandfather: he knows the ropes. The grey alive crushed itself in under the plinth, wriggled itself in under it." And in Circe Paddy Dignam, the man who has died, joins the rat in rattling the pebbles: "He worms down through a coalhole, his brown habit trailing its tether over rattling pebbles."