You can apologize to your friend for not being able to attend her birthday party by being honest and considerate in your communication. Here's a suggested message you can send:
"Hey [Friend's Name],
I hope you're doing well! I wanted to talk to you about your upcoming birthday party. I'm really sorry to say that I won't be able to make it this year. My final exam is scheduled from 7 am to 9 am, which means I won't be able to join your celebration from 8 to 10.
I feel terrible about missing your special day, and I wish I could be there to celebrate with you. Please know that it's not because I don't want to be with you on your birthday; it's just an unfortunate scheduling conflict that I couldn't avoid. I promise to make it up to you and celebrate your birthday in a different way once my exam is over.
I hope you have an amazing birthday party with all our friends, and I'll be thinking of you even though I can't be there in person. Let's plan something fun for when I'm free after my exams.
Once again, I'm really sorry, and I hope you understand. Enjoy your day, and let's catch up soon!
Best wishes,
[Your Name]"
This message conveys your apologies, explains the situation, and expresses your desire to make it up to your friend in the future. It also shows that you care about her and value your friendship.