Pressure effect on superconducting properties of two YB6 samples (Tc = 5.9 and 7.5 K) were investigated by measurements of electrical resistivity, magnetic susceptibility, and X-ray diffraction in the pressure range up to 320 kbar. Magnetoresistivity measurements down to 60 mK and up to 47 kbar have shown a negative pressure effect on Tc as well as on the third critical field Hc3 with the slopes dlnTc/dp = -0.59%/kbar and dlnHc3/dp = -1.1%/kbar, respectively. The magnetic susceptibility measurements evidenced that the slope of dlnTc/dp gradually decreases with pressure reaching 3 times smaller value at 112 kbar. The lattice parameter measurements revealed the volume reduction of 14% at 320 kbar. The pressure-volume dependence is described by the Rose-Vinet equation of state. The obtained relative volume dependence dlnTc/dlnV analyzed by the McMillan formula for Tc indicates that the reduction of the superconducting transition temperature is mainly due to hardening of the Einstein-like phonon mode responsible for the superconducting coupling. This is confirmed by the analysis of the resistivity measurements in the normal state up to T = 300 K performed at pressures up to 28 kbar.