Sedimentary rocks are the product of 1) weathering of preexisting rocks, 2) transport of the weathering products, 3) deposition of the material, followed by 4) compaction, and 5) cementation of the sediment to form a rock. The latter two steps are called lithification.
Once this initial energy is added, the wave travels through the medium until all its energy is transferred. In contrast, electromagnetic waves require no medium, but can still travel through one.