And I should amend that. You might conceivably attach to the Ray using Apple’s AirPlay 2, but I wouldn’t want to guaranty any sort of lipsync. Could be fine, might not be, but Sonos doesn’t have any control over AirPlay 2, it just plays it when it is received.
Ultimately, you’re trying to do something that Sonos wasn’t really designed for. They don’t make computer speakers, they make either networked music speakers, or home theater speakers, so it’s not hard to understand that it just isn’t that easy to connect to a normal monitor that doesn’t have an optical output. Or, as Ken suggests, a normal soundcard that has an optical output with either stereo or Dolby Digital .
However, you may want to read this FAQ.