Your entry into a Master's program is based on your grades/GPA - these programs stipulate a minimum GPA (or specific grades for certain subject, as was my case). So, it is imperative on you to pay more attention to your grades and improve your overall standing so that you meet this requirement (the requirements can be found on the target institution website).
Published papers, particularly if they are in high-level journals certainly won't hurt, but can not take the place of the grade/GPA level required by the graduate school.
Think of it this way, your grades are a reflection of your ability to master and apply the necessary knowledge and skills required as a foundation, at least, for any graduate program - the expectation is that this evidence of your abilities are at a certain level. Journal articles do show some application of skills and knowledge, but not of all the topics covered in your undergraduate studies.