The entrance of anything with a perceptible body into the body cavity through a recognized entrance, such as the mouth, would invalidate the fast. [Shurunbulal, Maraqi al-Falah]
As such, the usage of an asthma spray, for example, while one is fasting would invalidate the fast. If it is done due to a valid medical reason one would only be required to make-up that fast later on when one possesses the ability to do so.
If one suffers from chronic asthma, which requires usage of the spray or other medicine mutliple times a day, then one would be excused from fasting and would be required to pay expiatory payments (fidya) instead. You should consult a reliable Muslim doctor on the specifics of your condition to ensure that you will not be exposing yourself to harm when fasting, and whether you will be able to use the medication at times that permit you to keep a valid fast.