Beryl to Emerald
Beryl is composed of silicon, aluminum and oxygen, very commonplace elements for sure. But to be beryl, there must also be beryllium in the formula and that is a rare element - making beryl an uncommon mineral.
Emeralds are the mineral beryl. Emeralds in general are rare because the beryllium is uncommon and emerald's color-producing trace elements, chromium and vanadium, are even rarer. Merely mentioning their rarities does not really illustrate the overall rareness of emeralds. Beryllium is almost exclusively confined to the continental crust (upper crust) whereas the color-producing trace elements are located in the upper mantle (which is below the continental crust). That translates to the two needed ingredients almost never being in the same place under the right conditions. Thus emeralds are rarer than diamonds.