You get gems by shooting the boxes with question marks in each level. Load up any level and find a box with a question mark. Shoot the box and the gift will show up on board your ship in a random spot. Just simply take the gem, and put it in the station that is being used by the CPU character or your 2nd player friend.
The gem doesn't matter.
This can be done in 2 player mode or single player mode.