This post mentions that it is now legal to add a separate wire to ground an outlet. What is the proper way to do this? Does the wire need to follow the same path as the ungrounded 2 wire path? How would the ground enter the junction box? How is it secured?
What is the proper way to do this?
From the 2017 National Electrical Code:
(C) Nongrounding Receptacle Replacement or Branch Circuit Extensions. The equipment grounding conductor of a grounding-type receptacle or a branch-circuit extension shall be permitted to be connected to any of the following: (1) Any accessible point on the grounding electrode system as described in 250.50 (2) Any accessible point on the grounding electrode conductor (3) The equipment grounding terminal bar within the enclosure where the branch circuit for the receptacle or branch circuit originates (4) An equipment grounding conductor that is part of another branch circuit that originates from the enclosure where the branch circuit for the receptacle or branch circuit originates (5) For grounded systems, the grounded service conductor within the service equipment enclosure (6) For ungrounded systems, the grounding terminal bar within the service equipment enclosure
Does the wire need to follow the same path as the ungrounded 2 wire path?
No, it isn't required but if it did that would be preferable.
How would the ground enter the junction box?
It could be fished into another opening with a cable clamp.
How is it secured?
To the grounding-type-receptacle's ground lug and to the box, if it is metal, by means of a 10-32 ground screw.
There are many ways to accomplish this. These are the preferred methods of the trade but there are other acceptable ways.
I found a nice overview here:
The only legal way to install a 3 wire outlet without a ground is to feed it from a GFCI. As far as adding a ground wire you can tap another ground wire on any circuit that returns to the same service panel. Code only says the new wire can be run but not the path that it needs to take. If there is a grounded circuit close that is fed from the same panel use that it will save on wire and climbing around.