We describe an analytical approach that allows calculating the trajectories of an elastic beam within a two-dimensional phononic crystal-based gradient index medium. The formalism takes into account the anisotropy along the lines of inclusions where the equi-frequency contours may depart from a circle. We then report on a numerical and experimental study of the focusing of flexural Lamb waves in gradient-indexed phononic crystals. The silicon/air heterostructures that we considered for this work features an index that is obtained through the modulation along one axis of either the diameter of the air inclusions or their spacing. In both cases, numerical and experimental results agree very well. The formalism that we have developed explains well the location, shape and size of the focus in either system. Content from this work may be used under the terms of the Creative Commons Attribution 3.0 licence. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI. New J. Phys. 16 (2014) 063031 J Zhao et al New J. Phys. 16 (2014) 063031 J Zhao et al New J. Phys. 16 (2014) 063031 J Zhao et al 4 New J. Phys. 16 (2014) 063031 J Zhao et al 5 New J. Phys. 16 (2014) 063031 J Zhao et al New J. Phys. 16 (2014) 063031 J Zhao et al 7 New J. Phys. 16 (2014) 063031 J Zhao et al 9 New J. Phys. 16 (2014) 063031 J Zhao et al 13