Water coming in from skylight

New homeowner here, I have two skylights, they both have this "lip" on them, one has it on the bottom, the other on the top. I have a leak inside the house from the window with the "lip" on the top. I climbed onto roof and I do not see anything to stop water forming getting in. Am I looking at this correctly? Can I jay spray some flex seal on this?