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, put gems into all available slots and tap "Start Ritual". When the ritual is finished, you get one bigger gem that combines the value of all the merged gems.
On starting levels this value is doubled (if you merge two 50 gems, you will get 200, not 100). 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.