After working on the western frontier as a buffalo hunter with his brothers, he returned to Kansas. He and Ben Springer were the co-owners of the successful Lady Gay Dance Hall and Saloon in Dodge City, which employed the popular singer Dora Hand.
Masterson became the assistant marshal in Dodge City in June 1878. At that time Charlie Bassett was the Marshal, having replaced Jim's brother Ed, who was killed in the line of duty two months earlier. Wyatt Earp was a Deputy Marshal under Bassett at that same time, along with Earp's brother James. In the summer of 1878, a cowboy named George Hoy opened fire on the Comique Variety Hall, outside of which stood Masterson and Wyatt Earp. Earp had been involved in an altercation with Hoy previously. Both Earp and Masterson returned fire, and Hoy was shot from his horse by one bullet that severely injured his arm. Hoy died a month later, and Earp always claimed to have fired the shot that ultimately killed Hoy. However, that was never confirmed, and it is entirely possible that the shot was actually fired by Jim Masterson. Masterson, however, never disputed Earp's claim, and simply didn't comment.
He made several hundred arrests during the next two year time span, mostly of drunken cowboys who came through Dodge City on cattle drives. In November, 1879, he was promoted to Marshal after Bassett's resignation. He shot at least one man during his service with the Dodge City Marshal's Office, aside from the Hoy shooting. On April 6, 1881, he lost his job after a change in city government, and the belief that the long-standing hard-lined stance of the Marshal's Office was past its prime and no longer useful.
He fell out with his business partner, A.J. Peacock, over the hiring of the latter's brother-in-law, Al Updegraph, as bartender, and someone wired Bat Masterson in Tombstone that his brother's life was in danger. Bat arrived in Dodge on 16 April and saw Peacock and Updegraph near the station. Firing broke out, with Jim and others also taking part. Updegraph was the only casualty, taking a bullet through the lungs. Bat was fined for discharging a gun within the city limits and the brothers left Dodge.
Masterson moved to Trinidad, Colorado, where he joined the police force. While in Trinidad, Masterson arrested John Allen for the shooting death of Frank Loving, in what became known as the Trinidad Gunfight. In 1885 he became an under sheriff in Colfax County, New Mexico. In 1889, he took an active part in the Gray County War in Kansas. He was one of a group of lawmen who made a raid on the courthouse at Cimarron, which resulted in a famous gunfight known as the Battle of Cimarron.
He later moved to Guthrie, Oklahoma, and then later became a Deputy Sheriff of Logan County, Oklahoma. On September 1, 1893, as a Special Deputy U. S. Marshall, he was involved in the Battle of Ingalls, a gunfight in Ingalls, Oklahoma against the Doolin-Dalton gang, and was responsible for the capture of gang member "Arkansas Tom" Jones.
He died in Guthrie of tuberculosis on March 31, 1895, aged 39.