There are a few ways you can try to discreetly determine someone's ring size:
Borrow a ring: If the person you're buying the ring for already wears a ring on the same finger, you can borrow it for a short period of time and take it to a jeweler to be sized. Be sure to choose a ring that the person wears on their ring finger and make note of which hand and finger it's on.
Trace a ring: If borrowing a ring isn't possible, you can try tracing the inside of a ring that the person wears on their ring finger. Once you have the outline, take it to a jeweler to be sized.
Use a ring-sizing chart: Many jewelers provide ring-sizing charts that you can use to determine a person's ring size. You'll need to sneakily measure the person's finger, perhaps while they're sleeping, and then compare the measurement to the chart.
Ask a friend: If you're not trying to keep the ring a surprise, you can ask a friend or family member of the person you're buying the ring for if they know their ring size