Gems can be merged together to make a more valuable single gem. You can merge them in the totem. The process of merging is called "a ritual".
To start a ritual, tap on the totem in your dungeon, place gems into all available slots and tap "Start Ritual". When the ritual is finished, you will receive a larger gem that combines the value of all the gems you have combined.

This value is doubled at start levels (if you merge two 50 gems, you will get 200 instead of 100). The Guild level bonus can also increase the rating of the merged gem. Note, that once you start a ritual, the gems in the totem can be stolen by other players.