It's happened to the best of us. A friend tell you something in confidence and you spill it and they find out. Now, you look like a loser friend and everyone is giving you the stink eye. What do you do? Take responsibility. Nothing is more irritating than redistributing blame; "I told so and so not to say anything," or "It wasn't my fault, you know I can't keep a secret."
Loser move. If you spilled the beans admit it with an apology. Hopefully your friend will be forgiving and give you another chance. But, if he/she doesn't, give them space to process the betrayal. In Sophomore year, Grant tells a horrible secret about Marta to advance his own needs and he doesn't feel the repercussions of telling the secret until months later. If this happens, be prepared to lose your friend and get talked about because its almost guaranteed to go through the gossip mill. If your friend finally comes around and pardons you; know that he/she might not be sharing anymore secrets with you for awhile and that you may be on the outside of the pack until trust is rebuilt. Learn from your lippy mistake, put yourself in the other person's shoes and keep your big mouth shut.