Piping is usually sewn directly into the side seam of the pants. Piping is pretty easy to find at any fabric store, so you should be able to get the color you want without too much difficulty.
How you attach it really depends on your level of comfort with sewing. I do a lot of sewing, so if it was me, I would take a seam ripper and open up the side seam of the pants (leaving the waistband and everything else alone), then pin the piping in place and sew the whole seam closed again. Maybe a 20 minute project for me, on a sewing machine.
If you don't have a sewing machine or if the idea of ripping open the seam of a pair of purchased pants scares the bejeezus out of you, your other options would be hand-sewing or hot gluing the piping on top of the existing seam. In either case, you would want to fold under the flat part of the piping (the part that you would sew into the seam, in the above example), so that just the round puffy part of the piping shows. Then just use matching thread and tack it down every few millimeters, so it doesn't pucker when the pants move. Or, similarly, fold under the flat part of the piping and use a hot glue gun to attach it to the seam. Maybe an hour worth of work that way, but not too difficult.
Upcoming costumes - Dragon*Con 2013:
Steampunk Tinkerbell (original concept) - 100%
River Song - Day of the Moon dress (Doctor Who) - 100%, adding props
Samantha Winchester - Winchester Sisters (Supernatural genderswap) - 100%, adding props
Abaddon - As Time Goes By dress (Supernatural) - 90%