What causes migraines in certain individuals and how can they be prevented or treated?

What causes migraines in certain individuals and how can they be prevented or treated?