It has happened to me before,sometimes the song is gone upon waking,leaving only the knowledge of being close to something beautiful. Other times,if I'm quick and can get the rough melody line recorded,I can catch it. Those ethereal notions often disappear like frost in the morning sunlight.
I wrote a song once inspired by a friend asking where my song ideas come from and mixed it with the Keith Richards quote/misquote of songs being left by angels. Someday I must record it properly,it currently resides in the backlog bank.