what is the difference between segment and rays