DIAGNOSIS This is usually a mismatch between your TV's optical output level and how the Ray is interpreting it. Some TVs send a very low-level signal via optical, making the Ray seem quiet.
FIX First, check the setting in the Sonos app. 1) Open the Sonos app and go to Settings > System > [Your Ray]. 2) Tap "Audio Compression." Make sure this is set to "Off." When it's on, it can make quiet sounds louder and loud sounds quieter, which can feel like low overall volume. If it's already off, go back and tap "Volume Limits." Make sure "Maximum Volume" is set to 100 and "Volume Limit" is toggled off.
IF THAT DIDN'T WORK The fix is often on the TV side. Dig back into your TV's sound settings. Look for an option related to the optical output called "Digital Audio Out" or "Optical Output." Change the setting from "PCM" to "Dolby Digital" if available, or vice-versa. One of these formats often sends a stronger, more consistent signal that the Ray can work with better. You'll need to test and see which one gives you better volume control range.
HEADS UP If you're using your TV remote to control the Ray's volume (via HDMI-CEC or IR), the volume steps might just be very small. You might just need to press the volume up button more times to get to a comfortable level—this is normal. The number displayed (like 50) is relative within Sonos, not an absolute decibel level.