How can we detect X-rays? I know that X-rays can be detected by various ways, like ionizing of air particles.
Is there a way to detect X-rays,which are photons, by detecting? Can something absorb the energy of the X-rays and detect if it is there?
 A: There are many ways to detect X-rays. I will list just a few that are (or have been) used in medical imaging. Essentially there are several strategies, but it always involves stopping the radiation and using the energy released to effect a change - chemical or electrical - that can be detected.


*

*Photographic film. Exposure to Xrays has a similar effect to exposure to light. This can be combined with an "intensifying screen" -  a thin layer of scintillator material that converts a single Xray into a burst of photons. It increases the efficiency but reduces the spatial resolution. This is the original X-ray from Roentgen (1895)

*Scintillators - a class of materials (similar to phosphors) that absorb the energy of the incident radiation and emit multiple photons of lower energy (often in the visible spectrum). The light produced can be read out with photodiodes, photomultpliers, avalanche photodiodes, silicon photomultipliers, and other photo sensors. This is the workhorse for radiation detection in medical imaging today - especially at higher energies. It is used for most (digital) Xray, CT, PET and SPECT imaging.

*Xenon - because of the high Z it has reasonable stopping power for Xrays (especially when under high pressure: 10 - 25 bar typically). The ionization results in conductivity that can be detected (current flows where exposure occurred). It was common in CT detectors in the 90s, but has been replaced by scintillator / photodiode detectors.

*Selenium - similar to old-fashioned Xerox process, you charge a semiconductor with a surface charge. Exposure to ionizing radiation causes the charge to dissipate in some places; reading out the residual charge shows you where the radiation occurred. This is sometimes called CR - computed radiography. It is the "poor relative" of digital Xray.

*Direct conversion materials - for example CdZnTe (often called CZT). This is a semiconductor; when it absorbs the energy of an incident X-ray, electron-hole pairs are created. By applying an electric field across the material, you get an electrical pulse when the electrons arrive at the anode. Using pixelated anodes allows you to determine the position of the radiation accurately. The amplitude of the signal gives you the energy as well - this is particularly useful for SPECT imaging, where energy resolution is important for scatter correction (strictly speaking, SPECT uses gamma rays most of the time: the distinction is in the origin of the radiation, but in both cases you have a high energy photon).

*Ionization chamber: an assembly of crossed wires with high voltages between them is an effective radiation detector - the radiation hits the wires, and the electron that is knocked off ionizes the air; this then generates an avalanche, and you detect the position by looking at the pair of wires that carry the current

*Lead-walled straw detector: another geometry in which radiation interacts with lead, creates ionization, generates an avalanche, and is detected. See for example http://www.proportionaltech.com/new_site/index.php?option=com_content&view=article&id=109&Itemid=76
There are many other techniques in medical imaging and astronomy - this is just a list I wrote off the top of my head. For non-imaging applications, there's a whole slew of other techniques. You can see a pretty nice list of Germanium, Silicon/Lithium, and other detectors at the Canberra website.
A: Xrays are photons, so as suggested in the comments above, the photoelectric effect could be exploited by using an appropriate material.
For example, SAXS (Small Angle XRay scattering) machines use many kinds of Si based detectors. 
A: X-rays and gamma rays can be detected by using a scintillation detector.  
The scintillation detector comprises of NaI (Tl) crystal (scintillator) fixed tightly on a photomultiplier tube in a Gamma Ray spectrometer. For detection and measurement of gamma rays one inch or more thick scintillator in used. For X-rays thin scintillator is used. Portable Geiger Muller counter is used to know gamma radiation levels from sources like Cobalt-60. Reference: Radiation Detection and Measurement by Glenn F.Knoll Radiation Detection and Measurement
A: 
I know that X-rays can be detected by various ways, like ionizing of air particles.
Is there a way to detect X-rays,which are photons, by detecting ? Can something absorb the energy of the X-rays and detect if it is there?

Medicine uses X-rays continuously and the way it detects them is by exposing film that is kept in a dark container. Thus one disallows visible light contamination.
If you do not know the source of the photons and want to see how hard they are, you can expose film sequentially in a dark container covered by different materials and with different attenuation lengths to measure the energy.
