Ex-girlfriends that "act crazy" are more than likely dealing with a badly brusied ego. When a girl gets dumped, she may feel like she's done something wrong or is lacking something that you are seeking. (I'm going to assume you did the dumping.) As a result of the bruised ego, most girls unconsciously try to fix this by trying to get/win their guy back. I'm guilty of this and I'm sure a lot of other girls are too.
Depending on the length of time you dated, there are some simple solutions to ceasing your relationship/friendship/communication with her. If you were with her for a prolonged period of time, the best way to handle this is by NICELY explaining to her that it's extremely difficult for you to move on with your life when she is constantly contacting you. Tell her that you'd like to be friends (assuming this is true) but right now you need your space and when you're ready to be friends, you will contact her. If you were with her for a short period of time, I'd suggest the same in that you NICELY explain to her that you are not interested anymore and would appreciate her not contacting you in the future.
If none of this works, it may be time for you to cut off communication with her entirely. You may tell her that you cannot speak or see her anymore and if she chooses to call, you will not answer. Keep in mind, you cannot then call her. It goes both ways.
I'd be curious in getting more information about your situation so that I may be able to help more (knowing the specifics can allow me to gauge what is the appropriate action in your case).