"beam of light, light emitted in a given direction from a luminous body," early 14c., rai, from Old French rai (nominative rais) "ray (of the sun), spoke (of a wheel); gush, spurt," from Latin radius "ray, spoke, staff, rod" (see radius). Not common before 17c. [OED]; of the sun, usually in reference to heat (beam being preferred for light).
Ray is usually distinguished from beam, as indicating a smaller amount of light; in scientific use a beam is a collection of parallel rays. In ordinary language ray is the word usually employed when the reference is to the heat rather than the light of the sun .... [OED]
Science fiction's ray-gun is recorded by 1931 (in Amazing Stories; electric ray gun as an imaginary weapon is from 1924; death-ray gun from 1926 as a prop in a vaudeville act), but the Martians had a Heat-Ray weapon in "War of the Worlds" (1898).
"a skate, type of fish related to sharks and noted for its broad, flat body," early 14c., raie, from Old French raie (13c.) and directly from Latin raia. De Vaan describes this as a word of unknown origin but with apparent cognates in Germanic (Middle Dutch rogghe, Old English reohhe), perhaps a loan-word from a substrate language. The old etymology (Century Dictionary, etc.) was that the fish was so called from its resemblance to the rays of a fan and from the source of ray (n.1).