It's probably air in the master cylinder, but here's how I deal with it. First protect the paint on your bike by placing a towel under the right handlebar.
Then remove the cover. See that little hole in the bottom? That has to be higher than the hose end of the cylinder. Turn the fork and rotate the cylinder on the bar until the hole (or port, as it's technically called) is where it needs to be. Now carefully squeeze the lever. You'll see a stream of tiny bubbles rising from the port. Continue to gently pump the lever until no more bubbles appear.
It may be necessary to remove the master cylinder from the handlebar to get the port in the proper position. Be careful, and fill the reservoir only halfway to prevent spillage. You can bleed the cylinder off the bar like that. The lever doesn't have to be pulled far, just enough to slightly pressurize the cylinder.
Once the master cylinder is bled, you can gravity-bleed like OFG said. When you get a solid stream of fluid from the caliper, gently squeeze the lever while you simultaneously close the bleeder.
The master cylinder doesn't pressurize the reservoir, so there's no need for the cap to be on.