One of the craziest, most bizarre, and fun festivals of Spain is the Tomatina. Held in Buñol (Valencia province) every last Wednesday of August, the festival is attended by 1000's of people from Spain and all over the world. The town's population is 9000, and tourists that come to be part of this chaos are anywhere between 20,000-40,000.
You probably guessed by now, as the name suggests, the festival involves tomatoes -- tonnes of them! Starting at 10am, the first round of trucks with tomatoes come to the town. Someone brave enough has to climb a greasy wooden pole about 3 floors high and cut loose a ham leg hanging from the top -- this is what marks the beginning of the festival.
After that, what else can you do with the tomatoes but throw them at each other! You have a whole hour to hit as many people as you want with as many tomatoes possible. Be sure to know that you are also a target for everyone there, so it's advised to go prepared with eye goggles (to prevent the tomato acid from stinging you eyes), and wear your swim suit.
It's quite an aggressive festival. People are often drunk and will try to rip your clothes off. Don't think that the tomatoes are all soft and ripe; in fact the contrary -- most of them are raw and hard, and they huuurttt! You're supposed to crush the tomatoes before throwing them, but of course nobody does that.
The fight lasts an hour after which a few trucks drive in to hose everyone off with water. Then you normally end-up in a bar, followed by the beach.
So if you are up for some squashy and ketchup-type-fight fun, from where you will come out wet in tomatoe puree, with a few bruises, red eyes and lots of friends -- do head over. It's one of those "once-in-a-time-have-to-do's" if you are in Spain at the time.
As for the origins of this crazy fiesta -- noone really knows the story. The first such fight was in 1944 and in honour of the town's patron saints.
It's very much a day trip from Madrid, so unless you feel like spending a night there, you can make it back comfortably before dinner time.
From Madrid, by bus it takes about 3.5 hours and most of the bus operators will take you there (e.g. Auto Res). There are no trains to Buñol from Madrid, but you could go to Valencia, spend the night and go to Buñol in the morning.
There are organised tours for the Tomatina, mainly from Valenica: Check out Go Spain! for a detail round-up of types of Tomatina Tours you can take. Any tourist information office in Madrid will have more details on Tomatina tours specifically from Madrid.
Whatever you choose, be sure to book a bit in advance. With the sheer volume of people heading to the town, both transport and accomodation gets booked out quickly.
To wear: swim suit, flip flops, goggles, rubber gloves if you have sensitive hands.
Clothes to bring: something to change into, a towel. However, don't worry about this too much -- post the fight, you will find many vendors selling you cheap T-shirts and towels.