There are two types of beta decay, beta-, and beta+. Either a neutron changes to a proton (beta-), or a proton changes to a neutron (beta+), followed by the emission of various particles and energy as described below.
Beta-
In beta- decay, the weak atomic force causes a down quark in a neutron to change into an up quark, which changes the neutron into a proton, releasing a W- boson. The change of the neutron into a proton raises the atomic number by one, while keeping the atomic mass number the same. The W- boson leaves the nucleus and then decays into an electron and an electron antineutrino.
Beta+
In beta+ decay, a source of energy is required, usually where the binding energy of the parent nuclide is less than that of the daughter, but also possible with K capture, discussed later. An up quark in a proton is converted into a down quark, changing the proton into a neutron, reducing the atomic number by one, while keeping the atomic mass number the same. A positron and an electron neutrino is emitted.
Gamma
When beta- and beta+ decay occurs, the nucleus can be left in a excited state. It "wants" to come back to ground state. When it does, it emits a photon with an energy representing that change in energy. This a gamma ray.
Delayed Gamma
Usually, the gamma event occurs quickly, within about 1 x 10-12 seconds. Some nuclides, however, have a meta-stable state, where they stay excited for a longer period of time, sometimes a very long period of time, before coming down and emitting the gamma. An example is Technetium-99m which has a meta-stable state with a half-life of 6 hours, and a gamma of 140 Kev. This is a very useful nuclide, that can be tagged with certain medically sensitive chemicals, injected into the body, and scanned, such as for a heart scan, with only the burden of the gamma, i.e. without the added burden of the beta-.
X-Ray
As a result of interactions in the nucleus, the electron cloud can become excited. An electron can be pushed to a higher state, it could be annihilated by a positron, it could be stolen by an alpha particle, or it could be lost to K capture as described below. When this happens, the electron cloud also "wants" to return to ground state, and it does so, each electron in turn and, each electron emits a photon with energy corresponding to the step-wise energy transition just taken by the electron. This is called an x-ray. Other than energy and origin, there is no difference between an x-ray and a gamma. In fact, since there is overlap between some of the lower energy gammas and some of the higher energy x-rays, it is entirely possible that they are indistinguishable.
K Capture
Sometimes, an inner shell (K) electron is captured by the nucleus in order to bring in extra energy, perhaps to initiate beta+ decay, or for other reasons, such as to emit a positron by itself, i.e. without the neutrino. It depends on the energy balance in the nucleus. When this happens, the electron cloud immediately reshuffles to a new ground state, emitting a burst of x-rays, as each electron, like a row of dominoes, falls down into a new quantum state.