A ns Nd:YAG pulsed laser has been employed to produce plasma from the interaction with a dense target, generating continuum and UV and soft x-ray emission depending on the laser parameters and target properties. The laser hits solid and gaseous targets producing plasma in high vacuum, which was investigated by employing a silicon carbide detector. The two different interaction mechanisms were studied, as well as their dependence on the atomic number. The photon emission from laser-generated plasma produced by solid targets, such as boron nitride (BN) and other elements (Al, Cu, Sn and Ta) and compounds such as polyethylene, has been compared with that coming from plasma produced by irradiating different gas-puff targets based on N2 and other gases (Ar, Xe, Kr, SF6). The experimental results demonstrated that the yields are comparable and, in both cases, increase proportionally to the target atomic number. The obtained results, focusing the attention on the advantages and drawbacks of the employed targets, are presented and discussed.