Something like this should work (file order is very important and this compares first line of first file with first line of second file):
awk '
NR==FNR {
a[NR]=$0
next
}
{
delete ary
delete ary2
x=y=len=i=k=0
x=split($0,ary,"");
y=split(a[FNR],ary2,"");
len=x>y?x:y;
while(len>0) {
if (ary[++i]==ary2[++k]) {
printf ary[i]
}
else
{
printf "-"
i--
}
len--
}
print ""
}' file1 file2
Test:
$ cat file1
aaabaaa
abcdefabc
aaabbbccc
$ cat file2
aaaaaa
abcabc
acacacac
Output:
aaa-aaa
abc---abc
a-----c--