I saw a beam of light in the night sky.

Literal

Night-sky [in-に] light-ray [subj-が] was-visible.

光線 ('ray of light, beam') is a Sino-Japanese compound — 光 ('light') + 線 ('line'). 見える is the spontaneous/stative 'be visible' verb (parallel to 聞こえる for sound). に marks the location of the visible thing.