You may break your fast when it is likely to make you ill or increase your current illness. Illness means that your body cannot function properly and does not refer to discomfort or a little pain from a headache, since fasting is supposed to be uncomfortable. For example, if you have a light headache but can still function, you should keep fasting. If you have a severe headache which prevents you from performing your daily responsibilities then you should break your fast. It is important to consult a medical practitioner who understands the value of fasting in Islam so they do not discourage you from fasting unnecessarily.
Shaykh Mustafa Umar