Two related examples of how "Boo!" might be used:

1) I have just crept up behind you, and for some reason desire to surprise or startle you. To this end, I will probably say "Boo!" as loudly and quickly as possible.

2) You are not best pleased with my startling antics, and wish to convey your displeasure. You decide, therefore, to boo me. In this case, you will say "Boo!" in a deep voice, quite slowly. I will then slink away, feeling suitably chastised.