Best friends' crush likes me

My best friend and I have known each other for almost 5 yrs now and there's this guy that went to her school and she likes him. I knew him from before because Hawaii is a tiny place and everyone knows everyone. Anyway the guy, my best friend, 2 of our other friends and me recently bused halfway across the island to go beach and the whole time he was flirting with me. I actually don't even realize he was until my other friend told me. And I guess I was unintentionally flirting back. I don't want to hurt my friend by going for a guy she liked first but I keep trying to deny to myself and her that I like him but I think I do. I don't know wtf to do!!