Running out of air is always a drag. You can't ride the bike any longer without trashing your rim or possibly the tire as well. It is also very hard to push the bike even if you have some place close you want to take it. A flat tire is a really deflating experience on a lot of levels! Here are a couple of guidelines to follow that may help should you ever be unlucky enough to run into a situation such as this.
First and for most is to get the thing to a safe place. If you just walked up to the thing after having sitting parked then great you probably have this covered already. If not and you where unlucky enough to be cruising down the road when you lost air then GET IT OFF THE ROAD! This can't be stressed enough for reasons of safety do not expect other motorists to see you or feel sorry for your problem and slow down to avoid hitting you and making things worse.
Second is probably a little redundant but figure out what made the tire go flat to begin with. A nail, bolt, screw or small puncture can frequently be repaired with the right tools while the wheel is still on the bike and you could be riding again shortly. A gaping gash in the side wall of face of the tire cannot and I would recommend that the tire at the very least needs to be removed from the rim and a large patch and or inner tube installed. In the instance of a large tear or slice you really should not ride on the thing and just change the tire but it is possible to some times get these to hold air as well with a well placed fully cemented patch piece on the inside of the tire. This is a very time consuming method and it truly is going to be faster to place new motorcycle tires on in most cases rather than repairing old ones. Options though are good to have.
Now that you have determined the cause of your ailment you will need to take action on it. Plugging a small puncture in motorcycle tires is an easy fix for the roadside style conundrums you may have. What you will need is a plug or repair kit. A repair kit can be found at most any auto parts stores or large retail chain stores with an auto department. If you have the ability to do it I recommend carrying one of these motorcycle accessories with you when you are on trips or almost anywhere. Some have patch pieces and even plugs not to mention you can even get them with inflation tools or supplies. A few even include emergency tire irons for those who want that option as well.
Mototiresonline.com has some great motorcycle accessories should you want that little bit of insurance to take with anywhere you go.
After you have repaired the tire fill it with air and get it rolling again. Watch your motorcycle tires like a hawk. Be careful for the rest of your trip. Short or long, you are on an unstable supply of traction and any unnecessary actions could flatten your tire again! Just ride smooth and easy the rest of the way to safety.