The method determines parameters to generate confocal ultrasound beams (B1,B2) inside a medium (4), and uses a device (1) comprising first and second ultrasound means (11,12) and first and second displacement members (13,14) for moving the ultrasound means (11,12). The parameters include signals s1,s2 to the ultrasound means (11,12), and the positions x1,x2 of the ultrasound means (11,12). The parameters are optimized for having a minimum amplitude a1,a2 of the signals s1,s2 and having an acoustic effect inside the medium (4).