Rims are protrusions of material on bedrock or cave deposits, usually smooth on the inside but rough and crystalline on the outside. They form from condensing water vapor depositing material, when warm mosit air flows over colder rock. Often, they are found around the edges of holes in floors or walls where small passages meet larger ones. In this case, the expansion of moist air into a larger space may result in a lowering of its temperature and deposition of material.
The photo below shows the more unusual case of a rim projecting from a speleothem, in this case a gypsum column in Lechuguilla Cave. This one may owe its formation to warm air rising from below into cooler zones of the upper cave.

AUTHOR: Dave Bunnell