Spill the beans means to let out a secret unintentionally or divulge some information which was hitherto known only to a few.
It is also used when a person confesses to something.
similar phrase : To let the cat out of the bag
1. If I spill the beans then you will not enjoy watching that suspense thriller.
2. The convict refused to spill the beans regarding his motives in the court.
3. I did not want to be a spoilsport and spill the beans about the surprise party that my father had arranged for my mother's birthday.