Window unit or central air? If it is a window unit, it may not be cost effective to try to get repaired.
If it is the outside unit of a central air system…
Like DCnDC said, it probably is a capacitor. If the fan spins freely, I have had some success with taking a thin stick and spinning the fan and, while the fan is freewheeling, turn on the disconnect which should be on the side of the house near the compressor. Of course, you have to have the thermostat on and set low enough to run the AC. That is, start the AC with the thermostat and while it is making that loud noise, run outside and shut it down with the disconnect. Wait 5 - 10 minutes for everything to cool off. Then, spin the fan and throw the disconnect to the ON position. If the fan speeds up, everything comes on and the house gets cooler, then it is most likely the capacitor. It will run a while like this, but the fan motor is going to run hot (because the capacitor is bad), but at least you know what the problem is. Even if you call a repairman, it is good to know that it should be less than $100 to fix it and you probably do not need a new unit.
If you are handy with tools, it is an easy fix, just a lot of screws that have to come out (be sure you shut down the disconnect–I’d do the circuit breakers, too, just for good luck–before you start). You will have to know what the capacitor looks like (google images for AC fan capacitor will give you a good idea). Once you find your capacitor (you may have two, in that case, start with the smaller one), take some pictures of how everything looks before you start taking any wires loose. Remove the connectors (they usually just slip on, it may take needle-nosed pliers to get them to slide off), and remove the capacitor. Take it to an electrical supply store (not a big-box store, but electrical supply) and the guy behind the counter should be able to get you a new one. The new one goes in just like the old one came out. While you have the unit open, clean it of any leaves, grass, cobwebs, etc that may be in there and inspect the wires for any burned or darkened areas. Once you have finished putting it back together (make sure you use all the screws and that you don’t lose any of the screws), try it out.
I have fixed three outside units like this over the past 20 years, although on one of them, I ended up having to replace the fan motor as well. I would have had the repairman replace the fan motor except I had him look at it a week earlier and told me the fan motor was fine, but I needed to replace the whole unit. It ran for a day or two after he left then stopped again. I got a new fan motor from the electrical supply store and it is still working fine (that was over 5 years ago). Needless to say, I don’t call them anymore. I mean, when they can’t fix it when you tell them what is wrong, they just aren’t worth having around.
[Ninjaed! Oh, if it on the 7th floor of an apartment building, I wouldn’t try to fix it, just call someone.]