The atmosphere of a transiting planet shields the stellar radiation providing us with a powerful method to estimate its size and density. In particular, because of their high ionization energy, atoms with high atomic number (Z) absorb short-wavelength radiation in the upper atmosphere, undetectable with observations in visible light. One implication is that the planet should appear larger during a primary transit observed in high energy bands than in the optical band. The last Venus transit in 2012 offered a unique opportunity to study this effect. The transit has been monitored by solar space observations from Hinode and Solar Dynamics Observatory (SDO). We measure the radius of Venus during the transit in three different bands with subpixel accuracy: optical (4500A), UV (1600A, 1700A), Extreme UltraViolet (EUV, 171-335A) and soft X-rays (about 10A). We find that, while the Venus optical radius is about 80 km larger than the solid body radius (the expected opacity mainly due to clouds and haze), the radius increases further by more than 70 km in the EUV and soft X-rays. These measurements mark the densest ion layers of Venus ionosphere, providing information about the column density of CO2 and CO. They are useful for planning missions in situ to estimate the dynamical pressure from the environment, and can be employed as a benchmark case for observations with future missions, such as the ESA Athena, which will be sensitive enough to detect transits of exoplanets in high-energy bands.