Had the same problem with my F-250. Ford puts a little piece of foam tape up there that stops the rattle. It gone on the wind deflector that pops up when the sun roof is open. With the heat/cold it will sometime come off or move. You might stick you head up there and see if you can find it. Once you put it back the noise with be gone.