Mouth ulcers...hmmm, I know an Oral Biologist quite well...

Proper name for them is Aphthous Ulcer. Unknown cause. Many causative factors have been linked to them...
Most common cause is stress. (Kids writing exams!!)
2nd most common cause is lack of sleep (which leads to stress!)
Deficiency in Immune system of saliva
Gluten allergy
Milk allergy
Vit B12, Iron, Folic Acid, Zinc deficiencies
Citrus fruits including Oranges and lemons
Peanuts
Best way to prevent these from happening is to take a good Vitamin B Complex supplement every day to boost the Immune system. Avoid any foods that can scratch or traumatize a mucous membrane. Then try cutting the above foods out to try lessen the chances of an ulcer.
Ulcers usually only happen where there is trauma to the mucous membrane of the mouth, even slight trauma. Through hot food, Biting a lip or cheek, trauma through scratching the membrane with Potato chips, toast etc etc. Once the membrane is breached, the Ulcer develops through a deficient Immune system response.
Treatment is paliative... ie: no cure, so just treating symptoms. Find out what works best for you.
The tried and tested, most effective way of treating them is Kenalog in Orabase. This is a CorticoSteroid ointment that helps prevent further inflammation and has a mild anaesthetic in it. Repeated application every few hours helps. There is no better treatment unfortunately.
In between, a mouthwash like Corsodyl, which has anaesthetic and antibacterial properties will help.