I have not found any special way to guarantee getting one of the rare items. It is completely random and the rarer the item the less chance of getting it.