If a friend tells you they’re gay, it means they trust and care about you enough to share this part about who they are. It doesn’t change who they are or who you are. It also doesn’t mean that they have a crush on you if you happen to be the same gender. It can make the friendship stronger if you thank your friend for trusting and caring about you enough to tell you.
It’s not ok to tell anyone else your friend’s sexual orientation – not only is it disrespectful, it can be unsafe for your friend.