If the hub flanges are the same diameter, a slightly inexact but highly likely to succeed rule of thumb is that the calculated lengths for a conventional three-cross 26", 27.5", or 700C disc wheel are likely to give you a difference of right around 1mm in optimal length between the right and left side, so if you know your existing left spoke is optimal than just getting 1mm longer is likely to work. (The number is right around 2mm for non-disc rears). Unfortunately there are some stumbling blocks. Usually the actual difference in calculated length is more like .9mm-1mm for fronts and 1.2mm for rears, which means that there are corner cases where if you did this in front where the left you had was at the stone limit of thread length and you added 1mm, you might run out of thread length and the spoke wouldn't work. If the spare you have is the same as what's in the wheel, you could pull off the rim strip and check how the thread engagement is looking to preempt this. That would also let you know whether to get the same length or that length +2mm if you went to buy the spoke and found they only had 2mm increments, which is pretty common. Note this rule of thumb doesn't work the same for smaller wheels or cross patterns other than 3x.
You could just calculate it using a published ERD (effective rim diameter), and if you had an accurate ERD then that would work well since you can measure the hub, but the problem there is that published ones often aren't quite right, sad but true.
A pretty exact length can be found by reverse-calculating the ERD if the left spare you have is the same as what's in the wheel. You can pull off the rim strip as above and do a careful measurement to determine its exact difference from optimal length, probably easiest done by counting visible threads and multiplying by the thread pitch. Measure the spare, add or subtract that difference from optimal thread engagement, then measure or estimate the left side tension on the wheel and use either math or something like Machinehead Wheelcalc to get the amount of spoke elongation the ones in the wheel currently have and factor that in, and the result should be the ideal "stretched" left side length. After measuring the hub, you then have all the tools you need to use a spoke calculator like Damon Rinard's spocalc.xls to reverse-calculate the ERD of the rim by plugging in different ERDs until you hone in on the one that matches your measured optimal stretched left length, and then the calculator will also be telling you what the ideal right side stretched length is, from which you'll then have to compensate for elongation. (Good spoke length calculators use the classic spoke length formula that works off the pure geometry of the wheel as though it were just a bunch of circles and lines, and leave it to you to compensate for elongation.)
If you wanted to just measure the built wheel to get an ideal spoke length, use a tape measure, piece of string, etc to get the most accurate measurement you can from the inside of the J (the actual point of contact with the hub flange) to the point where the spoke inside its nipple intersects the inside surface of the rim. It can be tricky to measure so do it a couple different ways until you're confident. From there you want to add the thickness of the rim including eyelets if present and the thickness of the head part of the nipple, and then subtract for elongation. You can get the base thickness of the rim by snaking the depth gauge part of a Vernier caliper through the valve hole. 2mm is a good general number to use for the nipple head height; that errs low but that will result in spokes that are slightly short rather than slightly long, which is what you want so that you don't run out of thread length while trying to change a spoke in the middle of nowhere. For the elongation, .5mm on the less-tensioned side and .8mm on the full-tension side are pretty safe general purpose number for either 2.0 or 1.8mm spokes, but there are more exacting approaches that can be taken.