In The Making of Star Trek and the Star Fleet Technical Manual, the device is identified as a ray gun. According to the Manual the weapon is an offensive/defensive area weapon. The weapon has a diamond emitter tube and two buttons, one for stun and the other for disrupt. The stun setting delivers a wide stun beam with an effective range of 180 meters and an 8 meter diameter effective area at that range. The disrupt setting fires a lethal beam with the range of 90 meters and a diameter of 3 meters.
This prop was reused in other episodes, with different functions. In "The Doomsday Machine", Kirk uses it as a soldering device. The clear, acrylic tip of the mechanism appears to be identical to the directional medical scanner located on the underside of the diagnostic panel above the convalescent beds in sickbay.